THotPDF.UseObjectStreams 속성

 

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 구문:

property UseObjectStreams: Boolean;

 

C++ 구문:

__property bool UseObjectStreams;

 

설명

UseObjectStreams가 true이고 UseXRefStream도 true이면, EndDoc은 eligible indirect object(dictionary, array, number, name, string, boolean, null)를 ISO 32000-1 7.5.7에 따라 하나 이상의 /Type /ObjStm container stream으로 pack합니다. 이후 cross-reference stream은 type-2 entry(host ObjStm object number + 해당 stream 내부 entry index)를 통해 packed object를 참조하므로 개별 N G obj ... endobj framing byte와 per-row textual xref entry가 제거됩니다

 

가장 compact한 PDF 1.5+ writer pipeline을 위해 UseXRefStream property와 자연스럽게 짝을 이룹니다. ObjStm packer는 stream object, encryption dictionary, trailer가 가리키는 Catalog 및 Info dictionary를 uncompressed 상태로 두므로 최소 PDF parser도 document root를 찾고 content를 decrypt할 수 있습니다

 

Default value: false (opt-in).

UseObjectStreams를 true로 설정해도 UseXRefStream이 꺼져 있거나(type-2 entry는 spec상 textual xref table로 표현할 수 없음) Version이 PDF 1.5보다 낮으면 조용히 false로 downgrade됩니다

 

PDF/A-1에서도 강제로 off됩니다. ISO 19005-1(PDF 1.4, clause 6.1.4)은 compressed object stream과 이를 실어 나르는 cross-reference stream을 금지하므로, PDFACompliance가 part-1 level을 지정하면 EndDoc은 classic xref table을 emit합니다. PDF/A-2 및 PDF/A-3(PDF 1.7)에서는 계속 사용할 수 있습니다

 

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 dictionary(multi-page documents, annotations, AcroForm widgets, structure-tree elements, Optional Content layers)가 많은 document에서는 절감량이 일반적으로 post-FlateDecode file size의 20-40%입니다. 30-page graphics-only smoke test는 14502 byte에서 8488 byte로 줄어듭니다(-41.5%)

 

See Also

UseXRefStream, Compression, Version, PDF Filter Support