Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How's pdf rendering in Firefox? Chrome headless has its issues with headers and footers


Firefox uses PDF.js[1] to render pdf. This is a standalone project to render pdf in the browser using html and js. If I remember correctly, you can even render pdf in chrome using this.

[1]https://mozilla.github.io/pdf.js/


It's good, however it's not possible to use the remote debugging protocol for printing to PDF yet.


I just used Chrome headless to render several thousand pdfs last week and I saw no issues in version 73


Did you have a reason to not use PDFium directly?


Likely part of a web scrapping project that may require navigation or other browser things to get to. Or they are trying to avoid detection with a more real browser (you have to change some stuff first).


Can you recommend any resources for getting started with pdfium?


Sorry I'm in that position myself. A couple of years ago I compiled it without too much difficulty, and the included example I tried out rendered a page to a .png. Doing that for that for thousands of PDFs would just take a loop (or find -exec) if you have the files locally.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: