Menu

When loading PNG file into PDF file

Help
2010-12-08
2013-04-25
  • karikalan p

    karikalan p - 2010-12-08

    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.

     
  • Stuart Bryson

    Stuart Bryson - 2010-12-12

    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

     

Log in to post a comment.