THotPDF.UseObjectStreams Property THotPDF.UseObjectStreams Property THotPDF.UseObjectStreams Property THotPDF.UseObjectStreams Property THotPDF.UseObjectStreams Property THotPDF.UseObjectStreams Property THotPDF.UseObjectStreams Property

 

THotPDF.UseObjectStreams

THotPDF

 

Top  Previous  Next

Imballa gli oggetti indiretti idonei in /Type /ObjStm container streams (ISO 32000-1 7.5.7) to cut on-disk PDF size.

 

Sintassi Delphi:

property UseObjectStreams: Boolean;

 

Sintassi C++:

__property bool UseObjectStreams;

 

Descrizione

Quando UseObjectStreams is true (and UseXRefStream is also true), EndDoc imballa ogni oggetto indiretto idoneo - dizionari, array, numeri, nomi, stringhe, booleani, null - in uno o più /Type /ObjStm di stream contenitore secondo ISO 32000-1 7.5.7. Lo stream di riferimenti incrociato referenzia poi gli oggetti imballati tramite voci di tipo 2 (numero oggetto ObjStm ospite + indice della voce dentro quello stream), così i singoli N G obj ... endobj i byte di incorniciatura e le voci xref testuali per riga vengono eliminati.

 

Si abbina naturalmente al UseXRefStream property for the most compact PDF 1.5+ writer pipeline. The ObjStm packer leaves stream objects, the encryption dictionary, and the trailer-pointed Catalog and Info dictionaries uncompressed so even minimal PDF parsers can still locate document roots and decrypt content.

 

Valore predefinito: false (opt-in).

Setting UseObjectStreams to true silently downgrades to false when UseXRefStream is off (type-2 entries are not representable in the textual xref table per spec) or when Version è precedente al PDF 1.5.

 

Viene anche forzato a off sotto PDF/A-1: ISO 19005-1 (PDF 1.4, clausola 6.1.4) vieta gli object stream compressi insieme agli stream di riferimenti incrociato su cui viaggiano, così EndDoc emette una classica tabella xref ogni volta che PDFACompliance names a part-1 level, while PDF/A-2 and PDF/A-3 (PDF 1.7) leave it available

 

Esempio di codice

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;

 

Riduzione delle dimensioni

Sui documenti dominati da piccoli dizionari indiretti (documenti multipagina, annotazioni, widget AcroForm, elementi dell'albero di struttura, livelli Optional Content) il risparmio è tipicamente del 20-40% della dimensione del file post-FlateDecode. Un smoke test di 30 pagine solo grafica si restringe da 14502 byte a 8488 byte (-41,5%).

 

Vedi anche:

UseXRefStream, Compression, Version, Supporto dei filtri PDF