|
THotPDF.CompressLoadedDocument
|
Top Previous Next |
|
Compresses a loaded PDF: the parameterless form recompresses unfiltered streams, and the form with options runs every lossless size reduction HotPDF offers
Delphi syntax: function CompressLoadedDocument: Integer; overload; function CompressLoadedDocument(const Options: THPDFLoadedDocumentCompressionOptions; out AInfo: THPDFLoadedDocumentCompressionInfo): Integer; overload;
Description The parameterless form returns the number of streams whose compressed payload was adopted Uses CompressionLevel to select fastest, default, or maximum zlib compression; Processes each source stream in bounded chunks and replaces it only when the compressed payload is smaller Streams that already have a This compatibility helper delegates to OptimizeLoadedStreams with only Call
With options The form with options runs these steps in order, each one lossless: it drops unused page resources, merges identical fonts and Form XObjects, subsets the embedded fonts (compact subsets where the font allows it), recompresses streams with FlateDecode when that is smaller, and makes the next save use object streams. Images are not resampled or recompressed. The result is the number of rewritten objects, and Every step rewrites bytes a signature covers, so by default the call refuses a document that carries signature fields and changes nothing; set A three-page document of English and Chinese text that embeds full Arial and SimSun fonts drops from about 10 MB to about 20 KB
See also: THotPDF, OptimizeLoadedStreams, SubsetLoadedFonts, CompressDocument |