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
NJ4SFDCNJ4SFDC 

How to Visualforce renderAs 'pdf' - I want no margin and full image on the last page of my pdf.

Hi Developers,

I am rendering a dynamic visualforce pdf having first and last page as image. I am able to set the full first page backgrounf image using @page:first but for last page I am stuck. I dont want any marigin Image should fit full size on last page.

I really need this help.User-added image
Dushyant SonwarDushyant Sonwar
You can use the margin-top and margin-bottom css property to reduce the margin.
Please check below help article.
Alter Margin (https://help.salesforce.com/articleView?id=000332979&type=1&mode=1)
NJ4SFDCNJ4SFDC
Hi Dushyant, Page margin applies to all the page and I want this margin in all page except the last one. I hope you got my question.
Dushyant SonwarDushyant Sonwar
Apologies , didn't understand the question previously . I understand your question now.
It seems like there is no solution as CSS3 has removed the :last css selector .

You can try with :blank selector, but i am not sure whether that will work or not.

https://www.w3.org/TR/css-page-3/#page-selectors