Blogroll

The New Domino Admin

A great source of information for Lotus Domino administrators

ecmarchitect.com

Jeff Potts' excellent ECM/Portal blog

Jared Ottley

Lots of very useful Alfresco articles

Looking for web hosting?  I have been using DreamHost for years and have found them to be reliable, inexpensive and very good at what they do!  Click below to sign up, use promo code 'unorganized' to get a free domain registration and 10 bucks off your first year of hosting!

 

dreamhostBadge

Home Software and Tech Software Development Alfresco PDF Watermarking Update - v0.95
Alfresco PDF Watermarking Update - v0.95 PDF Print E-mail
Written by Nathan McMinn   
Thursday, 21 October 2010 19:35

Version 0.95 of the Alfresco PDF Toolkit has been released, sporting a major change to the PDF watermarking feature.  Previously, as referenced here, PDF text watermarks were applied using a simple "tag substitution" to include bits of metadata in the watermark.  This release removes the old "tagging" mechanism and adds support for FreeMarker markup in the watermark text instead.  The text watermarks are already much more functional than they were, supporting a subset of the default model specified in the Alfresco Template Guide.  The default model specifies the objects that are available to FreeMarker templates in the repository.  I intend to add support for most of the default model that might be useful to include on a watermark.  So far the following root objects are in the model.

 

userhome - current user's Home Space template node

person - Node representing the current user's Person object

space - The current space template node

document - the current document template node

date - a java.util.Date object representing today's date

 

Using FreeMarker markup in a PDF watermark is simple, just like using it in any other template in Alfresco.  When configuring the action in a content rule, just paste the FreeMarker markup into the "Watermark Text" field.  When the rule is run, the template is processed and the resulting text is applied to the PDF document as a watermark.  Easy, right?  For example, if you want to mark the PDF document with the username of the person that uploaded the document, just put the following in the Watermark Text field:

 

1
2
Document Added By
${person.properties.userName}

 

Or, if you would rather have the user's first and last names, you could use the following markup:

 

1
2
Document Added By
${person.properties.firstName} ${person.properties.lastName}

 

These are obviously simple examples, but they make the point.  If anybody out there has any other suggestions about what should be in the FreeMarker model for PDF watermark text, please send it along and I'll do what I can.

 



f you are accessing a template through the web-client UI using a Custom View for a space or the Space Preview action or via URL using the Template Servlet then the following named object is also provided:

space The current space template node.

If you are accessing a template through the Custom View for a document or the Document Preview action or via URL using the Template Servlet then the following named objects are also provided:

document The current document template node.
userhome Current users Home Space template node.
person Node representing the current users Person object.


If you are accessing a template through the web-client UI using a Custom View for a space or the Space Preview action or via URL using the Template Servlet then the following named object is also provided:

space The current space template node.

If you are accessing a template through the Custom View for a document or the Document Preview action or via URL using the Template Servlet then the following named objects are also provided:

document The current document template node.
Last Updated on Friday, 22 October 2010 22:26
 

Comments  

 
#4 Benjamin Rodriguez 2012-03-16 16:55
Very good, excelent, tested in alfresco 4.0.d
 
 
#3 Rolf Menzinger 2011-12-01 03:13
Hith Nathan,
we find a solution using a batch file solving our requirements. Maybe in our installation the JVM was missing.
 
 
#2 Nathan 2011-11-30 15:38
HI Rolf,

This component should be OS independent, as it runs under the JVM. I have used it on both winXP and Win7 without issue. Can you give me some additional details on your problem?
 
 
#1 Rolf Menzinger 2011-11-18 09:41
Nice Tool, but we have difficulties while upgrading from win xp to windows 7 / 64 bit.
Are there updates for this version?
 
RSS Feed Icon

About Me

 

My profile picture

 

My name is Nathan McMinn.  I'm a software engineer, beer geek, wannabe adventurer and genuinely curious guy.  Find me on Facebook, Linkedin or Twitter

Latest Comments