Subscribe to News feed

Merging dynamic data into watermarks using the PDF Converter for SharePoint

Posted at: 2:47 PM on 18 April 2011 by Muhimbi

mergeThe new 5.0 release of the PDF Converter for SharePoint provides quite a few new improvements, but perhaps the most highly anticipated new feature is the ability to apply watermarks to documents the moment they are opened. Now, it doesn’t make any sense to apply the exact same watermarks over and over again as that would be very inefficient, what you really want to do is adding data specific to the user who is opening the document.
 
This post is the second in a four part series:

  1. Applying user specific watermarks when a PDF document is opened in SharePoint.
  2. Merging dynamic data into watermarks using the PDF Converter for SharePoint. (This Post)
  3. Specifying filtering criteria when automatically applying watermarks.
  4. Apply User Specific PDF Security when a document is opened in SharePoint.

 

Adding this kind of dynamic information is done using merge fields, which can be entered directly into the watermarking text, for example: 
 
       PDF Opened by '{REMOTE_USER}' on '{LONG_DATE}' from IP '{REMOTE_ADDR}'
 
Which results in the following watermark:

Sample watermark with user specific data

 
Merge fields are not exclusive to the ‘watermark on open’ functionality, there are several other ways that watermarks can be applied using the PDF Converter for SharePoint, for example using workflows or web services. However, field codes are not always available for a particular interface as, for example, the web service has no knowledge about anything that happens in SharePoint, and workflows are not always associated with an HTTP Context.

As they say, a picture is worth a thousand words, which is why we have made the following table available to clarify which merge fields are available and under what circumstances.

   

Available from

Field Name Description

Web Service

Workflows

WM on Open

WM on Insert*

WM on Update*

{LONG_DATE} The long representation of the current date, e.g. 18 April 2011. V V V V V
{LONG_TIME} The long representation of the current time, e.g. 12:35:48. V V V V V
{DATE} The short representation of the current date, e.g. 7/03/2011. V V V V V
{TIME} The short representation of the current time, e.g. 12:35. V V V V V
{PAGE} The number of the current page in the PDF file. This value is automatically updated for every page. V V V V V
{NUMPAGES} The total number of pages in the PDF file. V V V V V
Any column name

Any SharePoint column / field defined on the list such as {Title}, {Author}. Please use (case sensitive) internal field names. See this list of internal field names.

Using workflow fields V V
(Lists only)
V
{HTTP_HOST} Returns the name of the Web server. This may or may not be the same as SERVER_NAME depending on type of name resolution you are using on your Web server (IP address, host header). V
{HTTP_REFERER}

Returns a string that contains the URL of the page that referred the request to the current page using an HTML <A> tag. Note that the URL is the one that the user typed into the browser address bar, which may not include the name of a default document.

V
{HTTP_URL} Returns the raw, encoded URL, for example, "/vdir/default.asp?querystring". V
{HTTP_USER_AGENT} Returns a string describing the browser that sent the request. V
{LOGON_USER} The Windows account that the user is impersonating while connected to your Web server. Use REMOTE_USER to view the raw user name that is contained in the request header. V
{REMOTE_ADDR} The IP address of the remote host (identifying the user) that is making the request. V
{REMOTE_HOST}

The name of the host that is making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this empty.

V
{REMOTE_USER} The name of the user as it is derived from the authorization header sent by the client, before the user name is mapped to a Windows account. If you have an authentication filter installed on your Web server that maps incoming users to accounts, use LOGON_USER to view the mapped user name. V
{SERVER_NAME} The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs. V
{URL} Gives the base portion of the URL, without any querystring or extra path information, for example, "/vdir/default.asp". V
{USER_NAME} The user’s name, if available (requires 7.2+). V

* In SharePoint 2007 automatic watermarking during Inserts and Updates is available in Lists, but not in Doc Libraries. Use workflows instead.      

 
If there is any other kind of data you would like to merge in as part of a watermark then leave a comment below or contact us directly and we'll consider it for a future upgrade.

.




Labels: , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link