Forum How do I...?

Prince logo is increasing file size upto 800s of kb. How do I fix it..?

sheraz
I have converted a simple html content to pdf using prince with a very small amount of text on it.. it has created a single page file successfully with a prince logo on that but with size of 828kb... after several tries I have found that prince logo on first page is taking 8 hundreds of kb which is increasing the file size...!

its driving me crazy....! I don't want to remove it .. but how can I reduce this file size.. please help...

thanks..

best
sheraz
mikeday
The Prince logo is very small. You can see the attached PDF file has a logo and the whole file is only 16kb in size, and almost all of that is the embedded font.

Which fonts are you using for your text?
  1. logo.pdf16.2 kB
sheraz
I am using Arial with font size 1.5em in <h1> and <div>.. attaching here with my sample pdf and html and css source.
  1. pdf sample.pdf847.2 kB
    pdf sample file
  2. sample html source.txt0.8 kB
    html and css

Edited by sheraz

mikeday
The embedded Arial fonts are very big. Which operating system are you running on? Did you specify --no-subset-fonts?
sheraz
Currently I am running it on windows 7 64 bit

I have added : $prince->setSubsetFonts(false); as well

attached is the entire html which is being compiled..
  1. sample html source.txt0.5 kB
    entire html
mikeday
Disabling font subsetting will cause the entire font file to be embedded in the PDF file, including all of its glyphs for other languages. This is why the PDF file is bigger than expected.
sheraz
awesome..! after turning subsetting to true the file size is reduced to 44kb.

thanks mikeday..