function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
withoutmewithoutme 

PDF border in visualforce

I have a custom button which renders a pdf page using visualforce. But the page needs to have a custom top/bottom/left/right margin (like 3mm). I know I need to use stylesheets, but I really dont know anything abt style sheets. Can someone help me please?

1. First - is it better to specify the style sheet as a static resource or directly in the vf page?.

 

2. I need to declare the style sheet after the <apex:page> tags right? but then I have to render the page itself with the margins specified in the style sheets. Will the style sheet take effect, even when it is specified after the <apex:page renderas="pdf"> tag?

 

3. How do I write the style? I'm a noivce when it comes to styles. Please help.

 

Thank you 

Edwin VijayEdwin Vijay

1) You can specify your styles within your VF page if your modifications are very minimal, but it would be good to use a .css file as it would be helpful for future modifications.

 

 2) Yes you need to specify it after your <apex:page> yag, but still the stylesheet has effect.

 

 3) http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=8987 would give you more insight. I am not sure if you can apply extensive styling, but @page works defenitely.

  

   www.w3schools.com/Css/default.asp

 

 Thanks