Previous | Next | (P-PDF) Engineering
Topic: How to linearize without massive byte increase?
Conf: (P-PDF) Engineering, Msg: 157473
From: rentthisspace
Date: 1/12/2007 12:03 PM
I have a plug-in that updates some metadata, and adds some dictionaries to define the associated index for the file.
When saving using the PDSaveIncremental flag, the file increases by an acceptable 5K bytes. But, the files aren't linearized.
When saving with PDSaveLinearized and the required PDSaveFull flag, the files increase to nearly double size. This is unacceptable for our purpose, since many of our original files are over 3MB, and increase to over 6MB.
Linearization is not available without save full, as stated in the following comment from PDExpT.h, where PDSaveFlags are defined:
/** Write the PDF file in a format that is optimized for page-served remote (network) access ("linearized").
This flag is ignored if PDSaveFull is off.
(Prior to Acrobat 7, linearizing a file caused Cos objects
to be renumbered, which required that some plug-ins use
notifications to release and re-acquire objects. In
Acrobat 7, objects are no longer renumbered.)
*/
PDSaveLinearized = 0x04,
...a further comment mentions garbage collection...
/** Remove unreferenced objects, often reducing file
size. Plug-ins are encouraged to use this flag.
This flag is ignored if PDSaveFull is off.
*/
PDSaveCollectGarbage = 0x20,
Here is my save call:
PDDocSave(activePDDoc, PDSaveFull | PDSaveLinearized | PDSaveCollectGarbage, asPathDest, NULL, NULL, NULL);
QUESTION: How to save linearized, but keep the size down?
"If you think education's expensive, try ignorance."