How to Add Watermarks to PDFs using Java

Clavin Fernandes

Clavin Fernandes

Related Products

PDF Converter

PDF Converter


As an ever increasing number of customers are using our PDF Conversion Services from Java based environments we have decided to make our sample code and tutorials available in Java in addition to C# / .NET. Have a look at this post for an introduction to using the PDF Conversion Web Services from Java based environments.

The C# / .net version of this post ‘ Using the awesome new watermarking features of the Muhimbi PDF Converter Services’ provides a good introduction to the watermarking capabilities of our PDF Conversion products. I recommend reading it, even if you know nothing about C#, as the fundamental principles and object model are exactly the same.

The Muhimbi Document Conversion Service contains a very flexible system for applying watermarks to documents. Multiple watermarks can be applied to the same page and watermarks can be applied to page ranges or certain page types such as odd, even, portrait or landscape. In addition you can add field codes such as {PAGE} and {NUMPAGES} to dynamically add page numbers, headers and footers to PDF documents.

Watermarks are passed as part of the ConversionSettings object, a parameter of the Convert method. An overview of the watermarking related Web Services interface is provided below. For full details see the full User & Developer Guide.


The following Java based sample code is identical to a previous sample, with the exception that the Watermarks property in the ConversionSettings class is populated with a simple watermark that prints the word ‘Confidential’ on the front page in combination with the current date. Note that this sample code is automatically installed with the conversion service.

For details on how to setup your Java environment and generate the Web Service proxies see this post.

Labels: Articles, Java, pdf, PDF Converter, PDF Converter Services


Clavin Fernandes

Clavin Fernandes

Developer Relations and Support Services @ PSPDFKit

Clavin Fernandes is a Microsoft Business Applications MVP and works in Developer Relations and Support Services for PSPDFKit.

Have a Question?
We’re Always Happy to Help.

© Muhimbi Ltd. 2008 - 2024
This website uses cookies to ensure you get the best experience. Learn more