|
Compression Overview
개요
HotPDF는 새 PDF content를 생성하는지, 외부 file에서 기존 stream과 image를 읽는지에 따라 여러 compression 및 decompression path를 사용합니다
Main Compression Paths
FlateDecode: THotPDF.Compression을 통해 생성된 PDF stream에 사용되며 zlib-compatible mode의 zlib-ng로 지원됩니다. 사용 가능한 경우 64-bit runtime SIMD dispatch를 사용합니다
- CompressionLevel: THotPDF.CompressionLevel selects
clNone, clFastest, clDefault, or clMaximum for enhanced Flate paths.
LZWDecode: HPDFLZW.pas를 통해 legacy PDF 및 TIFF-style data에 대해 지원됩니다
DCT/JPEG: HotPDF image support가 처리하는 standard JPEG image workflow에 사용되며 NASM SIMD acceleration object가 포함된 libjpeg-turbo 3.1.90으로 지원됩니다
JBIG2 및 JPEG2000: source format이 이미 해당 codec을 사용하는 specialized image workflow에서 사용할 수 있습니다
PDF 1.5+ structural size reduction
PDF 1.5+ output에서 HotPDF는 FlateDecode-compressed stream 위에 두 가지 추가 structural compression path를 계층화할 수 있습니다. 둘 다 opt-in이며 자연스럽게 함께 사용됩니다
- UseXRefStream: Replace the textual
xref ... trailer cross-reference table with a compressed /Type /XRef stream (ISO 32000-1 7.5.8). Cuts xref overhead by 4-10x on large documents.
UseObjectStreams: 작은 indirect dictionary(multi-page documents, annotations, AcroForm widgets, structure-tree elements, Optional Content layers)를 type-2 xref entry를 통해 참조되는 /Type /ObjStm container stream(ISO 32000-1 7.5.7)에 pack합니다. UseXRefStream도 켜져 있어야 합니다. 두 toggle을 함께 사용하면 30-page graphics-only smoke가 14502 byte에서 8488 byte로 줄어듭니다(-41.5%)
- Copy decompression: DecompressForCopy and
OriginallyCompressed describe how loaded-document copy paths materialize compressed source streams.
Related Units
- HPDFZLib.pas for FlateDecode and predictor-aware inflate helpers
- HPDFLZW.pas for LZW decompression
- HPDFJBIG2.pas for JBIG2 decoding support
- HPDFJpeg2000.pas and HPDFOpenJpeg.pas for JPEG2000-related workflows
See Also
|