Find your content:

Search form

You are here

renderAs PDF: Margin Problems


Good Day, I'm having trouble with renderAs in a Visualforce PDF   developed a HTML to generate a pdf from a custom object, this would cover that contains HTML fullscreen but visulforce are putting margins and this is causing my HTML if unconfigure all, tried to put

 <style type="text/css">
  @ page {
    margin: 0in;
    margin: 0px;
    margin: 0cm;
</ style>


But nothing works. Could you help me?

Attribution to: Guilherme Gobetti

Possible Suggestion/Solution #1

This is a bit of a guess but I think you might have a small syntax issue. Remove the space between the @ and page


@page {
    size: 21.0cm 29.7cm;
    margin-top: 2.0cm;
    margin-left: 0cm;
    margin-right: 1.5cm;
    margin-bottom: 2cm;

Attribution to: Salesforce Wizard
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content