Package org.apache.fop.pdf
Class FileIDGenerator
java.lang.Object
org.apache.fop.pdf.FileIDGenerator
- Direct Known Subclasses:
FileIDGenerator.DigestFileIDGenerator
,FileIDGenerator.RandomFileIDGenerator
A class to generate the File Identifier of a PDF document (the ID entry of the file
trailer dictionary).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static FileIDGenerator
getDigestFileIDGenerator
(PDFDocument document) Returns an instance that generates a file ID using the digest method recommended by the PDF Reference.(package private) abstract byte[]
(package private) static FileIDGenerator
Use this method when the file ID is needed before the document is finalized.(package private) abstract byte[]
-
Constructor Details
-
FileIDGenerator
FileIDGenerator()
-
-
Method Details
-
getOriginalFileID
abstract byte[] getOriginalFileID() -
getUpdatedFileID
abstract byte[] getUpdatedFileID() -
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
-