cancel
Showing results for 
Search instead for 
Did you mean: 

Watermark PDF on view/download

cristianfrog
Champ in-the-making
Champ in-the-making
Hi all, happy new year!

It's me again, I have to ask you to guide me through this because I can't get over it :<

I want to do this: watermark PDF files when user view or download the file from Share. The watermark will be a simple text or image.
I tried with a custom behaviour but someone here told me it's not the way on doing it… I was reading about thumbnails and rendition service, trasformation and stuff like that. I didn't find material about my specific problem so just want to ask if someone can tell me what to study exactly and how I can do it

I mean, what I need to know and put hands on?



P.S. I did contact some companies out there selling this but they do not sell code, only the closed service and for a lot of money, I will like to do it by myself and learn from it
9 REPLIES 9

scouil
Star Contributor
Star Contributor
Hi,

Basically what you need are 2 things:
1) A place to store your watermarked document (this one is optional but will prevent you from have to regenerate it on the fly every single time)
It can be either a rendition node (like the thumbnails you mentionned) or another cm:content field for your document.
2) An interceptor
That will kick in to replace the java function that return the content.
It will be pretty similar except that it will either pick the content from your other node (or field) or generate this content and store it in the right place

Good luck

cristianfrog
Champ in-the-making
Champ in-the-making

So basically I need to look up Alfresco's source code at the function where content is returned out?
Can you provide me some information about the function and where to find it out???
I need to write an AMP with my customization, right?

I will initially think of doing it with static node, it's easier for you it's ok, I need to learn first…
thank you in advance.

scouil
Star Contributor
Star Contributor
Hi,

Yes it would be either an AMP or a jar since it is some java code.
For the class to extend, look at org.alfresco.service.cmr.repository.ContentService . More specifically the getReader function.

jpotts
World-Class Innovator
World-Class Innovator
Have you taken a look at the <a href="http://addons.alfresco.com/addons/alfresco-pdf-toolkit">PDF Toolkit</a>? It's a freely-available open source project that adds watermarking and other PDF manipulating functionality to Alfresco.

Jeff

cristianfrog
Champ in-the-making
Champ in-the-making
Yes, I did but the addon is based on alfresco's rules and behaviours, so I can watermark documents only when I upload or move them. I will like to do it on the fly when user reads the document so I apply it with his account info like username, timestamp, email, and so on…

Thanks Scouil for the tip, I will look at that function, thank you…

leonard
Champ in-the-making
Champ in-the-making
Hi critianfrog

anyway does the pdf toolkit able to perform watermarking using username for user who read it?

romschn
Star Collaborator
Star Collaborator
I have not explored PDT Toolkit, however another option that you can go for is - iText. With the use of it, you can have watermark applied on PDF. You need to have a custom code to get it done the way you require.

christopheradam
Champ in-the-making
Champ in-the-making
We usually add and create a watermark to PDF file in order to help users ensure the document confidentiality and safety. As long as we choose a right <a href="http://www.rasteredge.com/how-to/vb-net-imaging/pdf-watermark-creating/">pdf watermark creating</a> plugin, we can be capable of adding a designed watermark and customizing it on many aspects, for example, typing any text word and phrase, full font options to customize the text font style, size and color, defining the watermark angle and orientation and even saving the created watermark on different ways.

ttownsend
Champ on-the-rise
Champ on-the-rise
Has anyone come up with an easily deployable solution for this?  I would like to deploy a solution for watermarking on download/access.