Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
21–30 of 82 posts
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#22I am guessing this works by splitting screenshots of a web page and gluing them as pages in the PDF file. Doesn't that mean the size of the PDF would grow to be large once it passes few pages? How does it handle content (like, tables) that don't have line breaks?
Page.printToPDF: https://chromedevtools.github.io/devtools-protocol/tot/Page/...
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#23Can it generate a table of contents with page numbers?
ebook-convert file.html file.pdf --pdf-add-toc
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#24Depending on your use case, I feel like you guys might be interested in http://weasyprint.org/. It is an open source HTML to PDF converter written in Python. It passes the Acid2 test and implements CSS Paged Media.
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#25I am guessing this works by splitting screenshots of a web page and gluing them as pages in the PDF file. Doesn't that mean the size of the PDF would grow to be large once it passes few pages? How does it handle content (like, tables) that don't have line breaks?
It uses Chrome's built-in print-to-PDF functionality via Chrome Debug/DevTools Protocol. In other words it creates PDF files with real vector graphics and text, not just images embedded in PDF. Page.printToPDF: https://chromedevtools.github.io/devtools-protocol/tot/Page/...
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#26Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#27Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#28How well does it work with multiple-page PDFs? One of our banes is generating mixed text/image downloadable reports with sensible page breaks. To save time, we're actually doing those as docx files, with the bonus/risk that clients can edit the content before saving it as a PDF.
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#29Nice work ! Depending on your use case, I feel like you guys might be interested in http://weasyprint.org/ . It is an open source HTML to PDF converter written in Python. It passes the Acid2 test and implements CSS Paged Media.
Re: Show HN: Pdf-Bot, an API/CLI for Generating PDFs Using Headless Chrome
#30Interesting to compare this to some of the "old school" solutions for converting web pages to PDF such as htmldoc[0] or html2ps[1]. [0] https://github.com/michaelrsweet/htmldoc [1] http://user.it.uu.se/~jan/html2ps.html
A better comparison would be against the likes of wkhtmltopdf[0], which uses webkit, or the pdf generation features of phantomjs.