Wednesday, 19 November 2014

Water Mark in visual force page rendrerAs PDF.



Use the below code to add water mark in PDF.

Click here to watch a demo: "http://lgdemosite-developer-edition.ap1.force.com/PDFwithWaterMark"

Download Sample image from here: "http://lgdemosite-developer-edition.ap1.force.com/servlet/servlet.FileDownload?file=01590000003ESga"

Here goes the code.

VF Page Code:

<apex:page showHeader="false" sidebar="false" renderAs="pdf">
<img src="{!URLFOR($Resource.WaterMark)}" width="100%" height="100%"
   style="position: fixed;background-repeat:repeat;left: 0cm; top:0cm; z-index:-999; opacity=10;"/><br/>
</page>