5 ms·
We use wkhtmltopdf and it works fine for us. But I would like better support for newer CSS. I like the functionality from Chrome to use it headless, but my mai
by casperb 6y ago
We use wkhtmltopdf and it works fine for us. But I would like better support for newer CSS.
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.
- SigmundA 6y agoChrome definitely does not render text or other vectors like SVG as an image. 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.
- infensus 6y agoMost of the time. I'm using Chrome via Puppeteer to generate PDF reports, and I've seen certain CSS rules make it render pages (or parts of them) as images. One of them was `transform` I think.
- SigmundA 6y agoYes transform may rasterize the content in order to transform it say as a GPU operation this is regardless of printing, this will be noticeable as blurry text and vectors on HiDpi displays.
- igeligel_dev 6y agoIt might be related on how you include fonts, I have seen a lot of weird behaviors unfortunately with that. Especially this response of an issue was important for my team: https://github.com/puppeteer/puppeteer/issues/422#issuecomment-380844283 https://github.com/puppeteer/puppeteer/issues/422#issuecomme... Source: working on automatic PDF reporting in my current company.
- majkinetor 6y ago> text is not selectable Here is reproducible demo that is selectable and clickable (links): - https://majkinetor.github.io/mm-docs-template/docs.pdf 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/ https://majkinetor.github.io/mm-docs-template/print_page/ This is all part of my mm-docs framework: - https://majkinetor.github.io/mm-docs-template https://majkinetor.github.io/mm-docs-template