0

This question already has an answer here:

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.

marked as duplicate by Raul, glls, battery.cord, Himanshu, Oleksandr Berehovskyi Nov 28 '17 at 6:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

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.

<style>

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

</style>

<body class="watermark">

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

</body>

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 '17 at 19:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.