Re:Show HN: ThePDFApi, a Chrome Based PDF Generation API Hos...
by kierenj on Wednesday May 30, 2018 @07:41AM
(#17186854)
This is probably a general headless-Chrome question, but - with something like this, how would you go about specifying margins, page breaks, etc?
[ Parent
| on HN ]
Re:Show HN: ThePDFApi, a Chrome Based PDF Generation API Hos...
by marcTPA on Wednesday May 30, 2018 @09:39AM
(#17187526)
For the margins there is a global setting in the API that will set the specified margins on the entire document. You can specify additional margins on top of this by setting a margin in css.
Page breaks are controlled by the CSS properties page-break-after, page-break-before and page-break-inside.