cancel
Showing results for 
Search instead for 
Did you mean: 

convert the word document to pdf and also want to add text type watermark

ratik_singhal
Star Contributor
Star Contributor
I want to convert the word document to pdf and also want to add text watermark in to converted pdf. Currently I am able to convert the doc,images and text files into pdf file by using rendition service.

—Code—-
renditionDef = renditionService.createRenditionDefinition('cmSmiley TonguedfRendition', 'reformat');
renditionDef.parameters["mime-type"] = "application/pdf";
—–

I am stuck in adding Watermark in converted pdf for word document while I am able to add watermark in images by using Imagemagick by overriding the 'RuntimeExecutableContentTransformerWorker.java' file.

——
<bean id="transformer.worker.png2pdf" class="com.formtek.repo.content.transform.CustomRuntimeExecutableContentTransformerWorker">

..
</bean>

command to add watermark (Imagemagick)

* convert logo.jpg -font Arial -pointsize 20 -draw "gravity south fill black text 0,12 'Copyright' fill white text 1,11 'Copyright' " wmark_logo.jpg

I am trying to override for the word document but it was not working ..

Please help !
10 REPLIES 10

rjohnson
Star Contributor
Star Contributor
There is an Alfresco wrapper around PDFBox called PDFToolkit which will do what you need. Google search Alfresco PDFToolkit and that should get you all you need.

Hello Bob.
Thanks for replying.. I have gone through the PDFtoolkit Addone and its source code. IText is used in this extension. I don't want to use IText.

Currently I am using Imagemagick to convert all images to pdf and also successfully added watermark into converted pdf file. But I was not able to do this type of thing for word document or text files.

kaynezhang
World-Class Innovator
World-Class Innovator
You can integrate third party applications to convert word or other document to pdf .
for example easypdf. http://www.pdfonline.com/easypdf/

If you would like to try desktop-based application, Kernel for Word to PDF Converter is recommended. Simply select the Microsoft Word document that you want to convert and choose a file name for resulting PDF file. Visit here : <a href="http://www.convertingwordtopdf.net/">http://www.convertingwordtopdf.net/</a>

rjohnson
Star Contributor
Star Contributor
Alfresco uses LibreOffice to display Word documents, and the chain is Word -> Open Office -> PDF -> SWF so you could create a custom transform chain that does Word -> Open Office -> PDF -> ImageMagik to watermark the PDF.

Alternatively you could possibly customise the OpenOffice transform which is done by LibreOffice to add a watermark at that stage.

Finally, there are versions of the PDFToolkit around that use the last GPL version of iText or you can get the source & recompile using the GPL versions.

hillton
Champ in-the-making
Champ in-the-making
I happen to know the method to <a href="http://www.coolmuster.com/pdf/save-word-as-pdf.html">convert Microsoft Word to PDF Format</a>,just use the Coolmuster Word to PDF Converter to convert Word files to PDF,this software can help you one click to export Word docx to PDF format.

christopheradam
Champ in-the-making
Champ in-the-making
According to my experience, when we convert <a href="http://www.rasteredge.com/how-to/vb-net-imaging/word-convert-pdf/">word to pdf</a> document, the text watermark won't be affected, and it will be appending on the converted pdf file.

alva
Champ in-the-making
Champ in-the-making
PDF format is the most safest and convenient way to present the e-document and to exchange data over web. As the PDF file is like an in age while uneditable which prevent others to access it. Thus to protect your office file you can convert them into PDF format by using a professional converter so that your document can remain secure.

http://www.softwaredownloadcentre.com/software/ists-pdf-covereter.php

sim2487
Confirmed Champ
Confirmed Champ
I am unable to open the pdf document which is inside the word document at the time of document preview. Is there any way alfresco have to do this?