You need to sign in to do that
Don't have an account?

how to add watermark to visualforce PDF ?
Hi, i have this watermark added to my visualforce PDF but it actually override all my text.
How can i push the watermark (png file) to the back?
<img src="{!URLFOR($Resource.tran_watermark)}" width="100%" height="100%" style="position:fixed; background-repeat:repeat; left:0cm; top:0cm; z-index:0; display:{!IF(quote.status == 'approved', 'none', '')}"/>
How can i push the watermark (png file) to the back?
NOTE: This code has not been tested and may contain typographical or logical errors
All Answers
NOTE: This code has not been tested and may contain typographical or logical errors
I am trying to watermark PDF document Saved in Salesforce not a visualforce rendered as PDF.
I have tried to follow your instructions but did not get any sucess :( Below you will find an example which i am trying currently?
Could you please check where i am making a mistake ?
<apex:page controller="TestPdfWaterMark" applyBodyTag="false" >
<head>
<style type="text/css" media="print">
<apex:outputPanel layout="none" rendered="true">
.watermark {
background-repeat: repeat;
background-image: url("{!URLFOR($Resource.watermarkExample)}");
background-position: center;
}
</apex:outputPanel>
</style>
</head>
<body class= "watermark">
<apex:iframe width="1000" height="1000" src="data:pdf;base64,{!pdf}"/>
</body>
</apex:page>A
Thanks in Advance !!
The only way I can think to do this would be to make a floating div that has 100% width and height and apply the watermark to that. You'd have to make sure it has a z-index above your iframe. The code you have above just renders the watermark behind the iframe and is not visible. You may however be better off using a service like Cloudinary (http://cloudinary.com/) to watermark the PDF data directly and then show that to the end user. Here (http://cloudinary.com/blog/adding_watermarks_credits_badges_and_text_overlays_to_images) is an example of how to do it.
Hi pcon,
thank you for your support so far. Do you know what I need to change in order for me not to add an img but a text line e.g. confidential?
Thank you in advance!
[1] https://developer.mozilla.org/en-US/docs/Web/CSS/::before