cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
107 stars 61 forks source link

Is there a way to decrease dpi to decrease pdf file size ? #116

Open gnans opened 4 years ago

gnans commented 4 years ago

Right now there in this plugin i don't see a way to reduce the pdf file size. If we can decrease a dpi value then pdf will decrease or anyone has suggestions to reduce the pdf file size

cesarvr commented 4 years ago

You can achieve something similar by controlling the viewport on the HTML you want to transform.

gnans commented 4 years ago

Thanks for the reply. Right now i am using "viewport" like this

meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no

in my application. I am testing this plugin in ipad pro ios version 13.4 and the pdf i am creating has 28 pages which has file size in 2.4mb. I want to reduce it to below 1mb. How can i achieve this using viewport.

Please help me on this

cesarvr commented 4 years ago

Sorry for the late response, I think the size depends on the kind of assets in the form of images your are embedding in the PDF.

If those pages contain images ?

Everything else in the PDF is usually postscript (like) language, that should be very light weight.