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

  • You'll probably get better help if you edit your post to include your markup... – Adrian Larson Dec 21 '16 at 22:04
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>
  • You don't have to @mention the OP... – Adrian Larson Dec 21 '16 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. – Vladyslav K Dec 21 '16 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 Dec 22 '16 at 7:26
  • But if say: @page{ margin: 0px; } It will do for whole page... – Igor Stosic Dec 22 '16 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 Dec 23 '16 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.