I am a Web Developer, and working in Linux environment.
Recently I have created a PNG image using php5 with jpgraph tool.
The PNG image file size is 45 KB.
After created the image I have placed/written the image into PDF file.
For display the image in the PDF file I have used PostScript and HARU PDF functions with two different examples.
The PDF file size is 6.5 MP.
The above examples If I used with JPEG image
The JPG image file size is 250 KB.
The PDF file size is 500 KB.
Why the file size is too much, when using PNG file ?
Please let me know if you find any issues.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had the same problem, but realised that you have to call
HPDF_SetCompressionMode(pdfDoc, HPDF_COMP_ALL);
BEFORE adding any images. This will ZIP compress the images. JPEGs are already compressed. This changed my PDF from 7+ mb to about 250kb.
I'm using version 2.0.8
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a Web Developer, and working in Linux environment.
Recently I have created a PNG image using php5 with jpgraph tool.
The PNG image file size is 45 KB.
After created the image I have placed/written the image into PDF file.
For display the image in the PDF file I have used PostScript and HARU PDF functions with two different examples.
The PDF file size is 6.5 MP.
The above examples If I used with JPEG image
The JPG image file size is 250 KB.
The PDF file size is 500 KB.
Why the file size is too much, when using PNG file ?
Please let me know if you find any issues.
I had the same problem, but realised that you have to call
HPDF_SetCompressionMode(pdfDoc, HPDF_COMP_ALL);
BEFORE adding any images. This will ZIP compress the images. JPEGs are already compressed. This changed my PDF from 7+ mb to about 250kb.
I'm using version 2.0.8