by casperb · 5y ago · 0 comments
I like the functionality from Chrome to use it headless, but my main problem with it is that text is not selectable in the rendered PDF. It seems to be an screencapture as image or something. Anyone has this working? Selectable text is really needed for generating PDF invoices.
Here is reproducible demo that is selectable and clickable (links):
- https://majkinetor.github.io/mm-docs-template/docs.pdf
This is done using puppetear.
The same can be achieved by Save as PDF in chrome of single page containing entire site:
- https://majkinetor.github.io/mm-docs-template/print_page/
This is all part of my mm-docs framework:
I just tried printing the Hacker News front page to PDF in Edge which is the same engine as Chrome and the text was selectable.
Source: working on automatic PDF reporting in my current company.