You need to sign in to do that
Don't have an account?
DaveIngram
How do I get backgrounds to render in my Visualforce PDF's?
Hi,
We are working on some document templates that i want to have a watermark background on each page.
It looks great as an HTML but when i try to render the page as PDF it looses the background .
Is there a way to fix this?
thanks
Dave
Dave, I'm working on documenting some best practices in this area. Can you share a code example from your templates, that illustrates the issue your having? I should be able to help you fix it.
I should have been more specific. What is the HTML/CSS technique you're using to add the background "watermark" image?
We recommend adding background images via CSS, rather than as attributes added in the HTML. I am working on a code sample, but if you provide yours, I can tailor it specifically to your situation. Otherwise, I'll post the generic example here tomorrow.
Hi,
I have tried 3 metholds:
here are examples:
Body{
font-family:"Tahoma";
font-size:20px;
background-image: url("tile.jpg");
}
these all render perfectly as HTML but when you saw to render as PDF the backgorunds dissapear.
I am wondering if the PDF is removing the background as it behaves like a printer sometimes.
thanks
Dave
@Alderete_SFDC,
Did you ever finish this documentation? I'm interested in generating PDFs with custom watermarks through visualforce and I've basically found it impossible. Any feedback or docs you can provide would be great.
No, sorry, this specific documentation topic got postponed. I have a blog post that's 3/4 finished, and need to resolve a couple of problems I can into with my sample code. I hope to get it done later this Summer...
Cool, thanks. Please let me know if/when you get to post it.