Setting page margins for printing in custom styles?

Viewed 4

Is there a way to specify page margins for printing in custom styles? I'm working on a custom style and hoping to be able to specify non-default page margins.

Looking through the CSS files on Marked's repo for custom styles, I see various uses of the @page { margin } approach but none of those seem to have any impact on the PDF generated by Marked when I use my style.

Any guidance would be gratefully accepted.

Ron

2 Answers

Unfortunately Marked has to use the older version of WebKit for the time being, and it doesn't recognize @page directives. It's just printing a view of the HTML to the PDF, though, so any margins you set on #wrapper --- in the main rules or in @print rules --- will show up in the PDF. Marked does some overriding of the CSS margins to keep things relatively uniform, so you may have to use !important on your rules to keep them in effect.

That said, the Settings->Export->Margins settings are the preferred way to adjust margins. You can't change that automatically per-style, though. Marked 3 introduces Export Profiles, so you can more easily switch between sets of export settings. I'll be announcing the v3 public beta this week or next.

Thanks, Brett. That makes sense and explains what I'm seeing, and I appreciate the quick response.