THotPDF.UseObjectStreams Property

 

THotPDF.UseObjectStreams

THotPDF

 

先頭  前へ  次へ

eligible indirect objects を PDF 1.5 /Type /ObjStm container streams (ISO 32000-1 7.5.7) に pack して、on-disk PDF size を削減します

 

Delphi syntax:

property UseObjectStreams: Boolean;

 

C++ syntax:

__property bool UseObjectStreams;

 

説明

UseObjectStreams が true で、かつ UseXRefStream も true の場合、EndDoc は eligible indirect objects (dictionaries、arrays、numbers、names、strings、booleans、nulls) を 1 つ以上の /Type /ObjStm container streams に pack します (ISO 32000-1 7.5.7)。その後 cross-reference stream は type-2 entries (host ObjStm object number + その stream 内の entry index) を通じて packed objects を参照するため、個別の N G obj ... endobj framing bytes と per-row textual xref entries は削除されます

 

最も compact な PDF 1.5+ writer pipeline のために、UseXRefStream property と自然に組み合わせられます。ObjStm packer は stream objects、encryption dictionary、trailer が指す CatalogInfo dictionaries を uncompressed のまま残すため、minimal PDF parsers でも document roots を locate し、content を decrypt できます

 

Default value: false (opt-in です。xref keyword を hard-code する tooling と PDF 1.4 / earlier readers への最大互換性のため、textual xref table を維持します)

UseObjectStreams を true に設定しても、UseXRefStream が off の場合 (type-2 entries は spec 上 textual xref table では表現できません)、または Version が PDF 1.5 未満の場合は、silently false に downgrade されます

 

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

small indirect dictionaries が多い documents (multi-page documents、annotations、AcroForm widgets、structure-tree elements、Optional Content layers) では、saving は通常 post-FlateDecode file size の 20-40% です。30-page graphics-only smoke test では 14502 bytes から 8488 bytes へ縮小します (-41.5%)

 

関連項目

UseXRefStream, Compression, Version, PDF Filter Support