Class PdfOptimizeResult


  • public final class PdfOptimizeResult
    extends java.lang.Object
    Outcome of a PdfOptimizer.optimize(byte[]) call: the rewritten PDF bytes plus before/after size and object-count stats, so a caller can tell how much (if anything) was actually cleaned up without re-parsing either file.
    • Method Detail

      • getOptimizedPdf

        public byte[] getOptimizedPdf()
      • getInputByteCount

        public int getInputByteCount()
      • getOutputByteCount

        public int getOutputByteCount()
      • getInputObjectCount

        public int getInputObjectCount()
        Total indirect objects in the input's object table -- includes ones no longer reachable, e.g. after an incremental-update edit.
      • getOutputObjectCount

        public int getOutputObjectCount()
        Indirect objects in the optimized output -- always exactly those reachable from /Root and /Info.
      • getRemovedObjectCount

        public int getRemovedObjectCount()
        Objects that were dropped, whether because nothing reachable from /Root//Info referenced them, or because they were merged as duplicate content (see getDuplicateObjectCount()).
      • getDuplicateObjectCount

        public int getDuplicateObjectCount()
        Of getRemovedObjectCount(), how many were removed specifically because they were byte-for-byte duplicates of another reachable object (e.g. the same font or image embedded twice) that got merged into one shared copy -- as opposed to being simply unreferenced. Always 0 when PdfOptimizer.Options.deduplicateContent was turned off.