enupal / snapshot

PDF or Image generation from a URL or HTML page easily for Craft CMS
https://enupal.com/craft-plugins/enupal-snapshot/
Other
11 stars 3 forks source link

Margin-top or header-spacing settings are not applied #47

Open johnwbaxter opened 2 years ago

johnwbaxter commented 2 years ago

No matter what I try, I cannot get Snapshot to apply the following config settings: "margin-top" or "header-spacing"

This is my code


{%
    set settings = {
    filename: entry.slug~'.pdf',
    inline: false,
    encoding:'UTF-8',
    cliOptions: {
        'footer-html': 'support-guides/_footer.twig',
        'margin-top': '40'
    },
    variables: {
        title: entry.title,
        body: entry.body,
        date: entry.postDate | date('Y')
    }

}
%}

Any ideas as to why it wont do anything? The content on the 2nd/3rd pages etc is really tight to the top of the page, i just want to introduce some spacing.

Thanks Andre!

andrelopez commented 2 years ago

Hi @johnwbaxter Could you please try to add the following css rule to your twig template? body { padding: 40px 0; }

Source: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1606#issuecomment-376181143