|
THotPDF.CompressLoadedDocument
|
Top Previous Next |
|
Compresses a loaded PDF: the parameterless form recompresses unfiltered streams, whilst the form with options runs every lossless size reduction HotPDF has to offer
Delphi syntax: function CompressLoadedDocument: Integer; overload; function CompressLoadedDocument(const Options: THPDFLoadedDocumentCompressionOptions; out AInfo: THPDFLoadedDocumentCompressionInfo): Integer; overload;
Description The parameterless form returns the count of streams whose compressed payload was adopted Takes CompressionLevel to pick 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 wherever the font allows), recompresses streams with FlateDecode when that is smaller, and makes the next save use object streams. Images are neither resampled nor 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 carrying signature fields and changes nothing; set A three-page document of English and Chinese text embedding full Arial and SimSun fonts drops from roughly 10 MB to roughly 20 KB
See also: THotPDF, OptimizeLoadedStreams, SubsetLoadedFonts, CompressDocument |