THotPDF.CompressFlateHighRatio Method

Creates a standards-compatible zlib stream and optionally improves it with budgeted Zopfli optimization

Declaration

function CompressFlateHighRatio(
  const Input: TBytes;
  out Output: TBytes;
  out AInfo: THPDFZopfliFlateInfo): Boolean;

The method first tries default, filtered, run-length, and Huffman-only zlib strategies at maximum compression, then runs Zopfli when ZopfliFlateOptions permits it

Output is never larger than the smallest zlib baseline because Zopfli is selected only for a strict byte reduction

The Boolean result reports whether a compatible output was produced; inspect AInfo.UsedZopfli to determine which encoder won

See THPDFZopfliFlateInfo and OptimizeLoadedStreams