I'm using PhantomJS to convert many (+500) web pages to PDF documents. Problem is, I keep getting quite large PDF files (approx 900 kb) for relatively small pages - 70 kb with images. Why they are so big? A simple "Save to PDF" in Firefox creates a 200 kb file, which is fine. I will soon have to process many other pages and file size will likely be an issue. Any suggestion?
EDIT: Here's two samples: output from PhantomJS and Firefox save to PDF
Even i am facing the same problem. I was trying to reduce the size of the pdf when there is large amount of data. What i have observed is, If you dump your textual content (Example paragraphs, tabular data, description etc) inside any of these headers tags (h1, h2 ...h6), This part of the content will be rendered as text in the pdf and not as image. This will reduce good amount of pdf file size.
I am not sure why the contents inside div, p, span tags are not treated as text but as image in the pdf.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With