Is there any way to add watermark to certain PDF files stored in document folder?

We would like to do a dynamic watermarking capability to the documents with confidential information of user who download the document. Is there a way to accomplish this or do we need to use a third party tool to make it happen?

In our case we have a VF page that displays the document assigned to them and they document the files from there.


1 Answer 1


Yes you can do this when you render a visualforce page as a pdf.

Just create a static resource that has your watermark image, and add the following lines to your Visualforce Page.


.watermark {
                background-repeat: repeat;
                background-image: url("{!URLFOR($Resource.WatermarkImage)}");


<body class="watermark">

<!-- some more stuff in here  -->


This will work when you render a visualforce page as a pdf.

You may need to wrap your document PDF to be displayed in a page like the one described above. If that's the case, you should check out this solution to render PDF in visualforce :

How to render PDF documents in visualforce page

  • 1
    Hi Mitch, in the future, you can use the code button ({} or Ctrl-K) to format your code in a gray code block with syntax highlights and proper spacing. I've went ahead and updated this answer for you.
    – sfdcfox
    Nov 27, 2017 at 19:14

Not the answer you're looking for? Browse other questions tagged .