Print Page | Close Window

Size PDF

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3897
Printed Date: 19 Apr 24 at 12:47PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Size PDF
Posted By: HJM
Subject: Size PDF
Date Posted: 17 Feb 21 at 2:23PM
How is it possible that a PDF with one page and one image of 37K has a size of over 8MB?
How can I reduce the file size



Replies:
Posted By: Ingo
Date Posted: 17 Feb 21 at 9:23PM
Hi Henri,

where's the file?
The 37 kb image won't be the only one inside...
Some hidden embedded inside should be there.
If i can have a look... i can tell more ;-)



-------------
Cheers,
Ingo



Posted By: HJM
Date Posted: 18 Feb 21 at 8:03AM
Hi Ingo
here's an example. BUT the code now generates a normal size and I don't know what changed. Could you have a look at this one??

Henri
PS I can't attach the pdf here??


Posted By: HJM
Date Posted: 18 Feb 21 at 8:10AM
Here it is
https://www.microstar.nl/XML/000507QP.PDF" rel="nofollow -
https://www.microstar.nl/XML/000507QP.PDF" rel="nofollow - https://www.microstar.nl/XML/000507QP.PDF



Posted By: HJM
Date Posted: 18 Feb 21 at 8:12AM



Posted By: mLipok
Date Posted: 18 Feb 21 at 10:12PM
Usually each separate font it is about 300Kbytes or even more.

But in your case you have 13 dfferent, embeded font.
And for example one of them is using 939280 bytes.

Use:
https://www.debenu.com/docs/pdf_library_reference/ReplaceFonts.php

btw.
I use https://www.winking.be/products/pdfanalyzer
to analyze yours PDF.

Check this:



and:




-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600


Posted By: HJM
Date Posted: 22 Feb 21 at 11:00AM
Hi MLipok
installed the program you suggested,but i got only 3 fonts embedded in the pdf..
I changed the code to not embed a font... and now it works, maybe because of embedded fonts but even 13 fonts dont make 8 mb ? But I cant figure out what changed the size eventually
But thanks for letting me know to look at the pdf this way.



Posted By: Ingo
Date Posted: 22 Feb 21 at 10:26PM
Hi Henri,


you should open your pdf with notepad to analyze by yourself (it's very easy).
Each embedded fontfile was inserted as stream.
Before each stream you'll find the size in bytes.

In your case try to search with...
/FontFile2
Besides this search string you'll find the object position for example:
/FontFile2 9 0 R
This means object 9 0.
If you try to search backwards to the beginning of object 9 0 you'll find this:
9 0 obj
<<
/Length 806504
/Length1 806504
>>
stream
...
This means that the first embedded font content has a stream length of 806504 bytes.

Go on searching you'll find the next object here:
/FontFile2 13 0 R
Searching backwards with 13 0 you'll find this:
13 0 obj
<<
/Length 111108
/Length1 111108
>>
stream
...
So the second embedded stream has a size of 111108 bytes.

At the end you've found 10 streams - each stream with a content size range from 100 kb up to 910 kb. These fonts are resulting in the large file size. Cause these embedded fonts are standard fonts and no special ones you should change to referenced fonts to have a small handy and fast loading file.


Cheers,
Ingo




-------------
Cheers,
Ingo



Posted By: HJM
Date Posted: 23 Feb 21 at 8:01AM
Thanks Ingo
This is clear for me


Posted By: mLipok
Date Posted: 23 Feb 21 at 9:55AM
Originally posted by HJM HJM wrote:

installed the program you suggested,but i got only 3 fonts embedded in the pdf..
You have about 10 fonts not 3.
I see you already check @Ingo explanation (how to check it with NotePad) and I try to do the same explanation with PDFAnalyzer.

Originally posted by HJM HJM wrote:

even 13 fonts dont make 8 mb ? But I cant figure out what changed the size eventually

The screenshot which I post to you cleary indicates that this specific fonts takes alomst 1MB size !!!

So why you was suprised that 13 or 10 fonts can make 8 MB ?
Did you not notcie the length of specific fonts from the screenshot ?


btw.
Thanks Ingo for the tip with checking in notepad.



-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk