php - Compress on the fly generated PDF files having embeded fonts -


we have apllication generates dynamic pdf files embeded nmsys fonts.

but it's size large in comparision original file having larger data dynamically generated having same fonts.

is possible reduce size of such pdf php script, api or extention ? , why source pdf (not generated script) of larger contents , same fonts have less size ?

edit

example -

file 1

file 2

file -1 generated our script it's bacically showing piece of information file 2. there 5 pages in file -1 , it's of 1.2 mb , file 2 having 158 pages of similar information of approx 4mb.

why size difference there?

i looked @ both files , difference indeed font related. saved both files optimised adobe acrobat xi - (can do) whole lot of optimisations important difference (for file 1) comes font subsetting:

file 1: 1.2 mb before / 253 kb after file 2: 4.7 mb before / 3.7 mb after

your file 2 created using framemaker produces pretty clean pdf (even if old version of adobe acrobat distiller used in case), file 1 generated dompdf, apparently without subsetting embedded fonts.

if @ space audit report out of acrobat first file:

enter image description here

you can see fonts take close 96% of space in file. subsetting font used in file option make smaller.

different libraries or applications have different options enable subsetting. dompdf use option dompdf_enable_fontsubsetting enable font subsetting in pdf files creates:

def("dompdf_enable_fontsubsetting", true); 

this embeds characters used in pdf file, (depending on amount of text , actual font) creating smaller files.

(dompdf solution added comments make answer more complete)


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -