THotPDF.UseObjectStreams Property

 

THotPDF.UseObjectStreams

THotPDF

 

Вгору  Попередня  Наступна

Pack eligible indirect objects into PDF 1.5 /Type /ObjStm container streams (ISO 32000-1 7.5.7) to cut on-disk PDF size.

 

Delphi syntax:

property UseObjectStreams: Boolean;

 

C++ syntax:

__property bool UseObjectStreams;

 

Опис

Коли UseObjectStreams = true і UseXRefStream також true, EndDoc пакує придатні indirect objects в один або кілька container streams /Type /ObjStm згідно з ISO 32000-1 7.5.7. Cross-reference stream потім посилається на запаковані об'єкти через entries типу 2, тому окремі N G obj wrappers зникають із тіла файлу

 

Це природно поєднується з UseXRefStream для компактного writer pipeline PDF 1.5+. ObjStm packer залишає stream objects, encryption dictionary і trailer-pointed Catalog та Info dictionaries нестисненими, щоб мінімальні PDF parsers могли знайти document roots і розшифрувати content

 

Default value: false (opt-in).

Setting UseObjectStreams to true silently downgrades to false when UseXRefStream is off or when Version is below PDF 1.5

 

Code Example

HPDF := THotPDF.Create( nil );
try
  HPDF.FileName := 'c:\Output.pdf';
  HPDF.Version := pdf15;          // Object streams require PDF 1.5+
  HPDF.UseXRefStream := true;     // ObjStm references need a /Type /XRef stream
  HPDF.UseObjectStreams := true;  // Pack indirect objects into /Type /ObjStm
  HPDF.Compression := cmFlateDecode;
  HPDF.BeginDoc;
  HPDF.CurrentPage.TextOut( 100, 100, 0, 'Compact PDF 1.5 output' );
  HPDF.EndDoc;
finally
  HPDF.Free;
end;

 

Size reduction

На documents, dominated by small indirect dictionaries (multi-page documents, annotations, AcroForm widgets, structure-tree elements, Optional Content layers), saving typically 20-40% of post-FlateDecode file size 30-page graphics-only smoke test shrinks from 14502 bytes to 8488 bytes (-41.5%)

 

See Also

UseXRefStream, Compression, Version, PDF Filter Support