Copy link to clipboard
Copied
Does anyone know which CSS paged media module properties are supported by HTML to PDF API? Is there documentation for this somewhere?
Margins seems to work, boxes not:
@page {
/* works */
margin-top: 15mm;
margin-bottom: 15mm;
margin-left: 15mm;
margin-right: 15mm;
/* no result */
@bottom-center {
content: "– " counter(page) " –";
}
}
Or better work with pagedjs.
Thanks
Roland
1 Correct answer
At the time of this writing the API supports Level 2.
The API also works with pagedjs for some features. Unfortunately, pagedjs sometimes creates invalid HTML that the browsers just kind of ignore but our API can't. I've not been able to work around these HTML errors.
Copy link to clipboard
Copied
At the time of this writing the API supports Level 2.
The API also works with pagedjs for some features. Unfortunately, pagedjs sometimes creates invalid HTML that the browsers just kind of ignore but our API can't. I've not been able to work around these HTML errors.
Copy link to clipboard
Copied
Thanks for the answer and your experience, good to know.
Copy link to clipboard
Copied
To test what works, use pagedjs and view the generated page. Then save the HTML and open that in an editor. You'll see the errors immediately. Most have to do with calculated values. I even tried editing the source of pagedjs and couldn't get it to work.
Copy link to clipboard
Copied
I'm not going to try pagedjs after what you've written. Margins and page-break-before, - after is working fine. Maybe Adobe will extend this at some point.
Copy link to clipboard
Copied

