Search code examples
wkhtmltopdf

How Can I control file size of pdf (S, M, L) based on image quality using wkhtmltopdf?


I have to control PDF size based on their image or content quality, how it can be achieved using wkhtmltopdf shell utility tool.


Solution

  • Based on the help section you can use the --image-quality <integer> parameter to control the quality of the images. Replace <integer> with a number between 1 and 100 where 100 is the best quality. I would suggest trying 80, sometimes 70 still gives acceptable results but it depends on the image.