1

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?enter image description here

1
  • You'll probably get better help if you edit your post to include your markup...
    – Adrian Larson
    Commented Dec 21, 2016 at 22:04

1 Answer 1

2

@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>
5
  • You don't have to @mention the OP...
    – Adrian Larson
    Commented Dec 21, 2016 at 22:39
  • 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.
    – Saroj Bera
    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.
    – Anshul
    Commented Dec 23, 2016 at 2:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .