PDFium Component Docs

Compressed Özellik

Component: TPdf  ·  Unit: PDFium
SaveAs / Save çağrıldığında çıktı PDF'sindeki akışların FlateDecode ile sıkıştırılıp sıkıştırılmayacağını denetler. Kaydettikten sonraki sıkıştırma motoru serileştirilmiş PDF'yi tarar, sıkıştırılmamış tüm akışları onların zlib ile sıkıştırılmış karşılıklarıyla değiştirir ve xref tablosunu yeniden kurar. Zaten sıkıştırılmış akışlar değişmeden geçer

Syntax

property Compressed: Boolean; // default True

Description

Compressed controls whether the next SaveAs (and family) call applies post-write stream compression. When True — the default — PDFiumPas serializes the document through PDFium, then runs a pass that replaces any uncompressed content / metadata streams with FlateDecode-compressed equivalents and rewrites the cross-reference table to reflect the new offsets.

When False, output streams are written as-is. The resulting file is typically 2-10× larger but is human-readable when opened in a text editor, which is useful for debugging content streams, comparing two PDF revisions with diff, or feeding the output into a PDF-syntax-aware tool that prefers uncompressed input.

Setting Compressed changes only the behavior of the next save; the in-memory document is unaffected. A document that was loaded compressed and saved with Compressed := False will decompress on output; a document loaded uncompressed and saved with Compressed := True will compress on output Round-tripping a fully-compressed document with Compressed := True yields a near-identical file size — the engine recognizes pre-compressed streams and does not re-deflate them.

Remarks

Example

// Save an uncompressed copy alongside the compressed original for debugging
begin
  Pdf.Active := True;
  Pdf.Compressed := True;
  Pdf.SaveAs('output.pdf'); // production copy
  Pdf.Compressed := False;
  Pdf.SaveAs('output_debug.pdf'); // human-readable copy
end;

See Also

SaveAs, Save, Active, Password