217
Views
3
Comments
Solved
[Html2PdfConverter] File size of the pdf
Question
html2pdfconverter
Web icon
Forge asset by Guilherme Pereira

Hi,


is there a way on how to reduce the file size of the pdf being generated by the html2pdf converter?


thanks in advance

2012-10-08 11-59-27
Guilherme Pereira
Staff
Solution

Hi Mark,


Im quoting this thread on stackoverflow with the exact same question.


The flag that works best for me in reducing file size is 

--image-dpi 300

As the default DPI is 600, this can reduce the filesize of an image-heavy PDF by 75% and is still good enough for most purposes.

There are two other flags you can use:

--lowquality - supposedly makes it smaller

--image-quality 80 - jpeg compression, default is 94

but overall I find the DPI makes the biggest difference, and if you aren't printing to 600dpi or zooming then you're not really losing anything.

For your use case also try

--no-outline - as you likely don't need a contents section

and the self-explanatory

--disable-internal-links

--disable-external-links

but these are likely to be smaller wins.


Hope this helps


Guilherme

2019-04-11 00-23-52
Mark Pineda

Guilherme Pereira wrote:

Hi Mark,


Im quoting this thread on stackoverflow with the exact same question.


The flag that works best for me in reducing file size is 

--image-dpi 300

As the default DPI is 600, this can reduce the filesize of an image-heavy PDF by 75% and is still good enough for most purposes.

There are two other flags you can use:

--lowquality - supposedly makes it smaller

--image-quality 80 - jpeg compression, default is 94

but overall I find the DPI makes the biggest difference, and if you aren't printing to 600dpi or zooming then you're not really losing anything.

For your use case also try

--no-outline - as you likely don't need a contents section

and the self-explanatory

--disable-internal-links

--disable-external-links

but these are likely to be smaller wins.


Hope this helps


Guilherme

Thanks Guilherme it works 


2018-03-07 19-33-49
Denise Fuentes

Hi, I just upgraded from OS 10 to 11 and the files that I got before conversion were like 80 to 90KB and now the same process is generating the same file as 4.4MB, I went to args in the generatePDF action but the dpi is not working, what can I do??  please help!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.