Add Barcode Watermarks when PDFs are Opened or Downloaded in SharePoint Online

In one of my recent  blog posts, we added a Barcode watermark to PDFs using Microsoft Flow (Power Automate) and The Muhimbi PDF Converter Online.  In this post, we’ll demonstrate how to automatically add Barcode watermarks when PDFs are opened or downloaded in SharePoint Online.

Adding watermarks when PDFs are opened or downloaded in SharePoint Online is especially useful when you don’t want to modify the source PDF that exists in SharePoint, but you still want to ensure that watermarks are always present whenever PDFs are opened or downloaded.

Before we begin, please make sure the following prerequisites are in place:

  1. Install the Muhimbi SharePoint Online App, with reference to this article 
  2. Elevate the App’s privileges and enable the advanced features, such as Watermark On Open, with reference to this article

You can also refer to this Video Tutorial – Configure Real time watermarking in SharePoint Online.

For the purposes of this post, we’ll use the document library configured in my previous article, Add Barcodes to PDFs using Microsoft Flow.

So, without further ado, lets configure our Library to add Barcode watermarks when PDFs are opened or downloaded.

Step 1: Navigate to your Document Library and click library settings.

SharePoint 
Add a page 
Add.Ä!upp 
Site contents 
Library settings 
Restore this library 
Site information 
Site permissions 
Site usage 
Change the look 
Connect to new Office 365 Group

Step 2: In the library settings, click on “PDF watermarking settings”.

Step 3: Configure the “Watermark Settings” screen with reference to the screenshot below.

Step 4: Copy the content below into the “Watermark content” section of the page and click on OK. To allow ultimate control over the look and feel of the watermarks, this example uses Muhimbi’s XML watermarking syntax.

<watermarks>
 <watermark	
 width="100"
 height="100"
 hPosition="center"
 hPosition="bottom">
  <linearbarcode
  width="100"
  height="100"
  barcodeType="Code39"
  omitStartStopSymbols="false"
  disableCheckDigit="false"
  showCheckDigit="false"
  text="{ProductCode}"
  />
 </watermark>
</watermarks>

The Above XML will add a watermark of Barcode type “Code39” that is 100 points by 100 points in size, to the center bottom of a page and the text is the contents of column {ProductCode}. Please note, points in a PDF are 1/72nd of an inch in size.

Available Barcode type, at the time of writing, are Codabar, Code11, Code32, Code39, Code39Extended, Code128, Code128A, Code128B, Code128C, GS1Code128, Code93 and Code93Extended.

That covers configuring the watermark.  Now, click “OK” on the “Watermark Settings” screen and just upload a PDF file to the Library and open it in SharePoint.  You should see a Barcode at the bottom of the page of the PDF as shown in the image below.

muhimbl 
PDF Converter - Installation 
& Administration Guide 
Muhimbi Ltd 
Version

Reference articles:

  • For an overview of how to configure and use the real-time Watermark & Secure OnOpen facility, see this article.
  • For answers to frequently asked questions about the ‘OnOpen’ facility, see this knowledge base article
  • For details on creating complex XML watermarking, see this article.

Subscribe to this blog for the latest updates about SharePoint Online, Microsoft Flow, Power Apps and document conversion and manipulation.

One thought on “Add Barcode Watermarks when PDFs are Opened or Downloaded in SharePoint Online

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s