Class FileIDGenerator

java.lang.Object
org.apache.fop.pdf.FileIDGenerator
Direct Known Subclasses:
FileIDGenerator.DigestFileIDGenerator, FileIDGenerator.RandomFileIDGenerator

abstract class FileIDGenerator extends Object
A class to generate the File Identifier of a PDF document (the ID entry of the file trailer dictionary).
  • Constructor Details

    • FileIDGenerator

      FileIDGenerator()
  • Method Details

    • getOriginalFileID

      abstract byte[] getOriginalFileID()
    • getUpdatedFileID

      abstract byte[] getUpdatedFileID()
    • getRandomFileIDGenerator

      static FileIDGenerator getRandomFileIDGenerator()
      Use this method when the file ID is needed before the document is finalized. The digest method recommended by the PDF Reference is based, among other things, on the file size.
      Returns:
      an instance that generates a random sequence of bytes for the File Identifier
    • getDigestFileIDGenerator

      static FileIDGenerator getDigestFileIDGenerator(PDFDocument document) throws NoSuchAlgorithmException
      Returns an instance that generates a file ID using the digest method recommended by the PDF Reference. To properly follow the Reference, the size of the document must no longer change after this method is called.
      Parameters:
      document - the document whose File Identifier must be generated
      Returns:
      the generator
      Throws:
      NoSuchAlgorithmException - if the MD5 Digest algorithm is not available