Subscribe to News feed

Watermarking features of the Muhimbi PDF Converter for SharePoint

Posted at: 10:19 on 25 October 2010 by Muhimbi

Over the past year we have published several blog posts about adding watermarks to PDF files using the Muhimbi PDF Converter for SharePoint. To make sure you pick the right technology for your purpose an overview of all relevant posts is provided below.

  1. Apply simple watermarks using the product’s native SharePoint Designer Workflow Actions. This post describes how to use the easy to use SharePoint Designer activities that ship with the PDF Converter to add basic watermarks to PDF files. Please note that this requires at least version 4.0 of the software.
     
  2. Apply complex watermarks using the product’s native SharePoint Designer Workflow Actions. If you wish to combine multiple shapes together in one or more watermarks then have a look at this post as it describes the use of the Composite Watermarking SharePoint Designer activity. Please note that this requires at least version 4.0 of the software.
     
  3. Apply watermarks using Nintex Workflow. Similar to all our other SharePoint Designer Workflow Activities, the watermarking activity is also available for Nintex Workflow 2007 and 2010.
     
  4. Applying user specific watermarks when a PDF document is opened in SharePoint. Adding watermarks the moment a document is opened using details specific to the current user, e.g. the time, user name, ip-address etc., is possible using this ground breaking new feature. 
     
  5. Apply watermarks from your own code using the web services interface. Are you writing your own C# or VB.net code? In that case you should consider talking to the Web Service directly in order to apply watermarks. This way you get access to all low level functionality exposed by our web services based interface.
     
  6. Apply simple watermarks using the Workflow Power Pack. Are you using SharePoint Designer to create workflows, but your needs are not met by the basic watermarking activities that ship with the PDF Converter for SharePoint? In that case you may want to check out this post. 
     
  7. Apply complex / dynamic watermarks using the Workflow Power Pack. If you have very complex watermarking needs, but still need to use SharePoint Designer for workflows, then check out this post. The sky literally is the limit when you use the PDF Converter in combination with the Muhimbi Workflow Power Pack.
     
  8. The PDF Converter User Guide. The product ships with a very comprehensive user guide. If you use the product from workflows, especially in combination with watermarking, then we recommend reading the entire guide, but specifically chapter 5.

 
You can always see the latest watermarking related posts by requesting all posts tagged with the Watermarking keyword.

As always, if you have any questions then don’t hesitate to contact us. Our support desk is very friendly and usually answers within minutes.

.





Labels: , , , , , ,

Watermarking PDF Documents using a SharePoint Designer Workflow - Part 2

Posted at: 09:22 on by Muhimbi

confidential4

Note that this post was originally written to show how to use the XML based watermarking syntax from a SharePoint Designer workflow. However, the same syntax can be used from our Nintex Workflow Activity as well as the Automatic Watermarking Facilities.

The Muhimbi PDF Converter for SharePoint contains a powerful watermarking engine that can be used to add watermarks to pages as well as adding headers, footers, page numbering and other recurring items. Multiple watermarks can be applied to the same page and watermarks can be applied to page ranges, page intervals or certain page types such as portrait or landscape.

In part 1 of this series I showed how simple watermarks can be added, one at a time, to a PDF file using a simple SharePoint Designer Workflow Action.  The disadvantage to this approach is that if you wish to combine multiple different shapes, e.g. a Circle, an Image and some dynamic text, then a separate watermarking cycle is carried out internally for each shape. This works well and will be fast enough for most occasions, but it is not the most efficient way to do it.

The separate Add Composite Watermark to PDF workflow action allows multiple watermarks to be applied in one go with each watermark made up of 1 or more individual shapes.

The workflow parameters are as follows:

Composite WM Action


The real power comes as part of the watermark.xml field that stores the XML that describes the multiple watermarks and elements. The XML for each individual shape is described below, but before we go into more details let’s start with an example.

The following sample code describes three watermarks.

  • The first adds an image of the company logo (in the foreground) to the top right of each page in the document.
     
  • The second adds the login-id of the user who created / changed the document to a random location in the background in a semi-transparent way.
     
  • The third adds an automatically generated page number to the bottom right of each page.

If you wish to run this example then please make sure the imageFilePath attribute is updated to a file on your system.

 

<watermarks>

  <!-- ** First watermark contains a single image element with the logo -->
  <watermark 
    hPosition="right" 
    vPosition="top" 
    width="200"
    height="73"
    zOrder="1"
    opacity="100"
    pageOrientation="both">
    <image
      width="200"
      height="73"
      scaleMode="maintainaspectratio"
      imageFilePath="watermarking/muhimbi-logo.gif"/>
  </watermark>

  <!-- ** Second watermark places the user's name in the background -->
  <watermark 
    hPosition="random" 
    vPosition="random" 
    width="300"
    height="200"
    zOrder="-1"
    rotation="-30"
    opacity="15"
    pageOrientation="both">
    <text
      width="200"
      height="200"
      fillColor="#000000"
      content="Insert 'modified by' field using SharePoint Designer"
      fontFamilyName="Times New Roman"
      fontSize="24"
      fontStyle="bold|italic"
      wordWrap="word"
      />
  </watermark>

  <!-- ** Third watermark adds page numbering -->
  <watermark 
    hPosition="right" 
    vPosition="bottom" 
    width="100"
    height="40"
    zOrder="1"
    pageOrientation="both">
    <text
      hPosition="left"
      vPosition="top"
      width="100"
      height="40"
      content="Page {PAGE} of {NUMPAGES}"
      fontFamilyName="Arial"
      fontSize="11"
      hAlign="left"
      vAlign="top"
      />
  </watermark>

</watermarks>

 

Watermark element
 

As the previous example shows, the watermarks element may contain multiple watermark elements. This watermark element again can contain one or more individual shapes such as text and images.

The watermark element acts as a container that determines where the watermark will be located, on which pages, before or behind the text, opacity as well as which page orientations the watermark applies to.

The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<watermark 
    hPosition="optional (absolute, random, left, center, right)" 
    vPosition="optional (absolute, random, top, middle, bottom)" 
    x="optional" 
    y="optional"
    width="required"
    height="required"
    zOrder="optional"
    scaleMode="optional (absolute, exactFit, maintainaspectratio)"
    scaleX="optional"
    scaleY="optional"
    rotation="optional"
    opacity="optional"
    pageOrientation="optional (portrait, landscape, both)"
    startPage="optional"
    endPage="optional"
    pageInterval="optional"
    pageRange="optional">

 

Text element
 

This watermark can be used to apply text to the foreground or background of one or more pages in the PDF file with full control over the font, style, size and color.

The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

  <text
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="optional"
      y="optional"
      width="required"
      height="required"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"
      fillColor="optional"
      content="required"
      fontFamilyName="optional"
      fontSize="optional"
      fontStyle="optional (regular, bold, italic, strikeout, underline)"
      wordWrap="optional (none, character, word, wordonly)"
      hAlign="optional (left, center, right, justify)"
      vAlign="optional (top, middle, bottom)"
      />


The text stored in the content attribute may contain embedded field codes such as the date or current page number. For details see section 5.5 Embedding field codes in the Text element of the User Guide.

When a lot of content is anticipated then you may want to remove the content attribute and instead place it inside the text element, for example:

  <text
      hPosition="optional (absolute, random, left, center, right)"
      ... rest omitted
      >
         Your content goes here, use a CDATA section if needed.
  </text>


SharePoint Designer lookup variables are also supported, which makes it possible for dynamic information stored in workflow variables, or in the Item’s columns, to be embedded in the watermark.

 

RTF element
 

The RTF watermark allows simple RTF encoded text to be added as a watermark. This allows more control over the look and feel of individual words in the watermark at the cost of added complexity.

An example of valid RTF is as follows:

{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard
This is some {\b bold} text.\par
}

The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<rtf
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="optional"
      y="optional"
      width="required"
      height="required"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"
      fillColor="optional"
      rtfData="required"/>

When a lot of content is anticipated then you may want to remove the rtfData attribute and instead place it inside the rtf element, for example:

  <rtf
      hPosition="optional (absolute, random, left, center, right)"
      ... rest omitted
      >
      Your content goes here, use a CDATA section if needed.
  </rtf>

Note that unlike the Text watermark, the RTF watermark does not support embedded Muhimbi field codes. However, SharePoint Designer lookup variables are fully supported to make it possible for dynamic information stored in workflow variables, or in the Item’s columns, to be embedded in the watermark.

 

Image element
 

Use the Image watermark to add common image types (BMP, JPG, GIF, PNG, TIFF, WMF, EMF / EMF+) as a watermark to a PDF document.

The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<image
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="optional"
      y="optional"
      width="optional"
      height="optional"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"
      fillColor="optional"
      imageFilePath="required"/>

The image at this path parameter expects the full path of the image relative to the current site, e.g. ‘shared documents/images/company_logo.gif’.

 

QRCode element
 

A range of different QR Codes can be added to documents using watermarks, ideal for embedding the document ID, or any kind of other SharePoint meta-data.

The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.

 <qrcode
      hPosition="optional (absolute, random, left, center, right)" 
      vPosition="optional (absolute, random, top, middle, bottom)" 
      x="optional" 
      y="optional" 
      width="optional" 
      height="optional" 
      zOrder="optional"       
      rotation="optional" 
      opacity="optional" 
      fillColor="#optional"
      lineColor="#optional"
      text="required"
      errorCorrectionLevel="optional (Low, Medium, Quartile, High)"
      inputMode="required (Binary, AlphaNumeric, Numeric)"
      version="optional (Auto, Version01, Version02, Version03 ... Version40)"
      />

 

PDF element
 

Existing PDF files can also be used as a watermark. This could be a dynamic file that is generated from, for example MS-Word, and then converted to PDF using the Muhimbi PDF Converter. Alternatively this could be a static PDF file that has been generated manually.

The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<pdf
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="optional"
      y="optional"
      width="optional"
      height="optional"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"
      fillColor="optional"
      pdfFilePath="required"/>

The pdf file path parameter expects the full path of the PDF name relative to the current site, e.g. ‘shared documents/static watermarks/company_logo.pdf’.

 

Rectangle element
 

A simple rectangle can be added as a watermark. The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<rectangle
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="optional"
      y="optional"
      width="required"
      height="required"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"
      fillColor="optional"/>

 

Line element
 

A line can be added as a watermark. The XML looks as follows (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<line
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="required"
      y="required"
      endX="required"
      endY="required"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"/>
 
 
 
Ellipse element
 

A circle or ellipse can be added as a watermark. (Please omit any attributes marked as optional from your code when they are not needed. Leaving them in with the ‘optional’ text will cause an error.)

<ellipse
      hPosition="optional (absolute, random, left, center, right)"
      vPosition="optional (absolute, random, top, middle, bottom)"
      x="optional"
      y="optional"
      width="required"
      height="required"
      zOrder="optional"
      scaleMode="optional (absolute, exactFit, maintainaspectratio)"
      scaleX="optional"
      scaleY="optional"
      rotation="optional"
      opacity="optional"
      lineColor="optional"
      lineWidth="optional"
      fillColor="optional"/>

.




Labels: , , , ,

Watermarking PDF Documents using a SharePoint Designer Workflow - Part 1

Posted at: 18:11 on 24 October 2010 by Muhimbi

confidentialThe Muhimbi PDF Converter for SharePoint has had the ability to apply watermarks to PDF files for quite some time. However, this really was only available to power users as it required either interacting with the Conversion Web Service directly or running custom code using our Workflow Power Pack.

Fortunately applying simple as well as complex watermarks is now within reach of all our users as, starting with the 4.0 release, we now include a free set of SharePoint Designer Workflow Actions that allow watermarks to be applied with a minimum amount of hassle.

What follows is an abstract from the PDF Converter for SharePoint user guide. For more details please check out chapter 5 as well as the Watermark Field Matrix Appendix.
 


 

The Muhimbi PDF Converter for SharePoint contains a powerful watermarking engine that can be used to add watermarks to pages as well as adding headers, footers, page numbering and other recurring items. Multiple watermarks can be applied to the same page and watermarks can be applied to page ranges, page intervals or certain page types such as portrait or landscape.

In addition to Document and HTML Conversion workflow actions, the Muhimbi PDF Converter also comes with a number of Watermarking related workflow actions for SharePoint Designer 2007 and 2010. These workflow actions allow elements such as text, rectangles, images, PDF files as well other shapes to be added to a document either in front of or behind the document’s content.

Note that these watermarks can only be applied to PDF files, so if for example an MS-Word file needs to be watermarked then it will need to be converted to PDF first in a separate step.

Each separate watermark workflow action is applied to the document separately. If multiple watermarks need to be applied in one go then you may want to have a look at part 2 of this series, Composite Watermarks.

 

WatermarkingAn example of what is possible, apply watermarks as well as page numbering to documents

 

The individual workflow actions are self-describing, but the following elements require special attention:

  1. this document: The document to apply the watermark to. For most workflows selecting Current Item will suffice, but some custom scenarios may require the look up of a different item. You may also want to check that the file type of the document is ‘pdf’ before trying to apply a watermark.
     
  2. this file: The name and location of the watermarked file. Leave this field empty to overwrite the source file with the watermarked copy. Enter a path, including the Document Library and any folder names, to write the watermarked file to a separate location. E.g. “shared documents/watermarked files/confidential.pdf
     
  3. List ID: The ID of the list the watermarked file was written to. This can later in the workflow be used to perform additional tasks on the file such as a check-in or out.
     
  4. Item ID: The ID of the watermarked file. Can be used with the List ID.
     

 

The Text watermark action
 

This workflow action can be used to apply text to the foreground or background of one or more pages in the PDF file with full control over the font, style, size and colour.

The SharePoint Designer workflow action is named Add Text watermark to PDF and the parameters are as follows:
 

Text WM Action

 
The text stored in the content field may contain embedded field codes such as the date or current page number. For details see section 5.5 Embedding field codes in the Text element in the User Guide.

SharePoint Designer lookup variables are also supported, which makes it possible for dynamic information stored in workflow variables, or in the Item’s columns, to be embedded in the watermark.

 

The RTF watermark action
 

The RTF watermark allows simple RTF encoded text to be used as a watermark. This allows more control over the look and feel of individual words in the watermark at the cost of added complexity.

An example of valid RTF is as follows:

{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard
This is some {\b bold} text.\par
}

The SharePoint Designer workflow action is named Add RTF watermark to PDF and the parameters are as follows:
 

RTF WM Action


Note that unlike the Text watermark, the RTF watermark does not support Muhimbi’s embedded field codes. However, SharePoint Designer lookup variables are fully supported to make it possible for dynamic information stored in workflow variables, or in the Item’s columns, to be embedded in the watermark.

Please note that due to a bug in SharePoint 2010, lookup variables in RTF text may have unexpected side effects. SP2007 works fine. We are working with Microsoft to fix the bug in SharePoint.

 

The Image watermark action
 

Use the Image watermark to add common image types (BMP, JPG, GIF, PNG, TIFF, WMF, EMF / EMF+) as a watermark to a PDF document.

The SharePoint Designer workflow action is named Add Image watermark to PDF and the parameters are as follows:
 

Image WM Action

 
The image at this path parameter expects the full path of the image relative to the current site, e.g. ‘shared documents/images/company_logo.gif’.

 

The PDF watermark action
 

Existing PDF files can also be used as a watermark. This could be a dynamic file that is generated from, for example MS-Word, and then converted to PDF using the Muhimbi PDF Converter. Alternatively this could be a static PDF file that has been generated manually.

The SharePoint Designer workflow action is named Add PDF watermark to PDF and the parameters are as follows:
 

PDF WM Action

 
The pdf file path parameter expects the full path of the PDF name relative to the current site, e.g. ‘shared documents/static watermarks/company_logo.pdf’.

 

The Rectangle watermark action
 

A simple rectangle can be added as a watermark using the Add Rectangle to PDF workflow action. The parameters are as follows:
 

Rectangle WM Action


 

The Line watermark action
 

A line can be added as a watermark using the Add Line to PDF workflow action. The parameters are as follows:
 

Line WM Action


 

The Ellipse Watermark action
 

A circle or ellipse can be added as a watermark using the Add Ellipse to PDF workflow action. The parameters are as follows:
 

Ellipse WM Action


 

The QRCode Watermark action
 

For details about adding a QR Code watermark, see this blog post
 


Continue to part 2, Composite Watermarks.

.




Labels: , , , ,

PDF Converter for SharePoint 4 - InfoPath attachments, HTML & Native SPD Watermarking

Posted at: 16:38 on 22 October 2010 by Muhimbi

PDFBox5

Christmas arrives very early this year for the users of the popular Muhimbi PDF Converter for SharePoint, and what a gift it is; a brand new box with “4.0” on the outside and lots of new goodies to play with on the inside.

Let’s have a look at some of the new functionality:

If you can’t wait to give it a go then proceed straight to the download link at the end of this post.

 
For those not familiar with the product, the PDF Converter for SharePoint is a lightweight solution that allows end-users to convert common document types to PDF format from within SharePoint using a friendly user interface, workflows or a web service call without the need to install any client side software or Adobe Acrobat. It integrates at a deep level with SharePoint and leverages facilities such as the Audit log, localisation, security and tracing. It runs on WSS 3, MOSS as well as SharePoint 2010 and is available in English, German, Dutch, French, Traditional Chinese and Japanese. For detailed information check out the product page.

 

In addition to the changes listed above, some of the main changes in the new version are as follows:

893 New - SharePoint Designer workflow activity to add composite watermarks to PDF files.
892 New - SharePoint Designer workflow activities for adding simple shaped watermarks to PDF files.
870 New - Web Service method to allow existing PDF files to be watermarked.
1110 Fix   - Borders are clipped incorrectly for watermarks.
1010 New - New HTML to PDF workflow activity for SharePoint Designer.
642 New - Support for HTML to PDF Conversion in Web Service as well as SharePoint Document Libraries.
1011 New - Support for PDF conversion of common image types such as BMP, GIF, PNG, JPG.
1007 New - Ability to convert SharePoint Pages to PDF using the Personal Actions menu.
785 New - Convert InfoPath browser forms using Forms Services and the HTML to PDF workflow activity.
1001 New - Automatically convert files attached to InfoPath forms to PDF.
993 New - Allow non-default InfoPath views to be selected for conversion to PDF.
1002 New - Allow multiple InfoPath views to be converted and merged into a single PDF file.
770 Fix   - File based XSN references are now decoded properly.
997 New - PDF Conversions can now be carried out using a simple hyperlink.
1028 New - "Convert and Download" option in the file context menu.
673 New - Allow range of InfoPath page numbers to convert to be specified.
992 New - Setup now alerts the user of potential 'loopbackcheck' problems.
836 Fix   - Applying Security on PDF files corrupts certain pages.
1020 Fix   - UI Breadcrumbs in SP2010 Central Administration

 

For more information check out the following resources:

 

As always, feel free to contact us using Twitter, our Blog, regular email or subscribe to our newsletter.

Download your free trial here (8MB). .

.





Labels: , , , ,

Need support from experts?

Access our Forum

Download Free Trials