Cool. Nice to learn of another option. What would be the advantages of using this over wkhtmltopdf ( https://wkhtmltopdf.org ) ?
Link to size bug: https://github.com/GoogleChrome/puppeteer/issues/666
21–30 of 95 posts
Cool. Nice to learn of another option. What would be the advantages of using this over wkhtmltopdf ( https://wkhtmltopdf.org ) ?
Link to size bug: https://github.com/GoogleChrome/puppeteer/issues/666
Cool. Nice to learn of another option. What would be the advantages of using this over wkhtmltopdf ( https://wkhtmltopdf.org ) ?
Headless Chrome is quite new so it still has some bugs, but I have a hunch that it will in the end have most reliable and expected render results.
I was playing around with Puppeteer the other day and was wondering if it was possible to render a web page to a single page PDF (a page with fixed width and variable height). Basically like creating screenshot without losing the text information. This would solve a lot problems such as sticky elements hiding text like in this example [1]. [1]: https://url-to-pdf-api.herokuapp.com/api/render?url=https://...
Sometimes you can get rid of the sticky headers with &emulateScreenMedia=false parameter if the page has well implemented @media print rules in CSS. We decided to use page.emulateMedia('screen') with Puppeteer to make PDFs look more like the actual web page by default.
Pages which use lazy loading for images may look incorrect when rendered. &scrollPage=true parameter may help with this. It scrolls the page to the bottom before rendering the PDF.
Using these options make the PDF better: https://url-to-pdf-api.herokuapp.com/api/render?url=https://...
I wonder how scalable the service is... At least with PhantomJS I felt like my system would begin to lockup if there were too many instances rendering at the same time (and it didn't appear to be an issue of too little memory). Nonetheless, this looks promising.
There's also room for improvement in how efficiently a single server instance can render PDFs. The API doesn't yet support resource pooling, this would make reusing the same Chrome process (with e.g. 4 tabs) possible. The implementation requires careful consideration since in that model it's possible to accidentally share content from previous requests to the new requesters.
Earlier quoted context omitted.
But its no scalable, making it serverless just makes scalable at a huge cost.
You are contradicting yourself. It is scalable. It scales linearly (and for practical purposes indefinitely) with the amount of money you spend on AWS Lambda. It might not have a nice constant factor, but it is scalable.
Unfortunately, the "sensible defaults" don't seem to check input URLs correctly and allow file:// URLs. Just try ?url=file:///etc/passwd on the demo instance. That seems to be a quite common issue with services like this built on generic libraries.
I've moved all my pdf to client side. Less security and processing on the server. http://pdfmake.org/#/gettingstarted