I have problem with footer as you can see on picture. Whole pdf page's margin is set 5mm left, 5 mm right 5 mm bot. Is it possible just to overwrite this margins and to move this footer like on image,5mm left, 5mm right and 5mm bot, but other pages must be same like i set at first. Can someone help me?
1 Answer
@Igor: For such scenarios, I usually prefer to remove margins at page level and introduce margins for required sections for e.g.
Page
<apex:page>
<!-- CSS -->
<style>
@page{
margin: 0px;
}
</style>
<!-- HTML -->
...
<div style="margin-left: 5mm; margin-right: 5mm">
<!-- Page body -->
</div>
</apex:page>
-
-
It is not guaranteed that CSS will work as expected, because Salesforce uses ancient PDF engine and it can ignore some CSS rules. Commented Dec 21, 2016 at 23:03
-
Yes Salesforce does not support all CSS rules, you have to try different combination of CSS to get the desired result. Commented Dec 22, 2016 at 7:26
-
But if say: @page{ margin: 0px; } It will do for whole page... Commented Dec 22, 2016 at 9:05
-
Yes using margin : 0px will definitely stretch to whole page. But then you can control the specific sections say content section to keep desired margin, whereas header and footer can be rendered with no margins, as I mentioned in my response above.– AnshulCommented Dec 23, 2016 at 2:35