Огляд стиснення

Огляд

HotPDF використовує кілька compression і decompression paths залежно від того, чи генерує новий PDF content, чи читає existing streams та images з external files

Main Compression Paths

  • FlateDecode: використовується для generated PDF streams через THotPDF.Compression і backed by zlib-ng у zlib-compatible mode, з 64-bit runtime SIMD dispatch де доступно
  • CompressionLevel: THotPDF.CompressionLevel selects clNone, clFastest, clDefault, or clMaximum for enhanced Flate paths.
  • LZWDecode: підтримується для legacy PDF і TIFF-style data через HPDFLZW.pas
  • DCT/JPEG: використовується для standard JPEG image workflows, handled by HotPDF image support і backed by libjpeg-turbo 3.1.90 з NASM SIMD acceleration objects
  • JBIG2 і JPEG2000: доступні для specialized image workflows, де source format already uses those codecs

PDF 1.5+ structural size reduction

Для PDF 1.5+ output HotPDF може накласти два additional structural compression paths поверх FlateDecode-compressed streams Обидва 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: pack small indirect dictionaries (multi-page documents, annotations, AcroForm widgets, structure-tree elements, Optional Content layers) у /Type /ObjStm container streams (ISO 32000-1 7.5.7), referenced through type-2 xref entries Потребує також увімкненого UseXRefStream Smoke на 30 pages graphics-only стискається з 14502 до 8488 bytes (-41.5%) з обома toggles
  • 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

Див. також