Class IncrementalPdfSigner


  • public final class IncrementalPdfSigner
    extends java.lang.Object
    Applies a PDF digital signature as a raw incremental update, on top of IncrementalUpdateWriter (the generic COS incremental-update mechanics -- object offsets, xref, trailer) from com.pd4ml.pdf.cos.writer. Everything in this class is specific to digital signatures: building the /Sig dictionary, the signature field widget, wiring it into the AcroForm and the target page, the optional visible appearance, DocMDP certification, and the /Contents//ByteRange placeholder dance a PDF signature's byte-range hash requires.

    Not supported: encrypted input PDFs. com.pd4ml.pdf.cos is a reader (its own docs: "this package is a reader, not a PDF writer/optimizer"), so it can decrypt while parsing but can't re-encrypt on write; appending plaintext new objects into an otherwise-encrypted incremental update would be worse than refusing outright.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      COSDocument getDocument()
      The parsed input document, e.g.
      SignResult sign​(ByteRangeSigner signer)
      Performs the whole incremental-update signing flow, calling signer exactly once, with exactly the bytes the resulting PDF signature is defined to cover.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait