Package org.apache.fop.pdf
Class FileIDGenerator
- java.lang.Object
-
- org.apache.fop.pdf.FileIDGenerator
-
- Direct Known Subclasses:
FileIDGenerator.DigestFileIDGenerator
,FileIDGenerator.RandomFileIDGenerator
abstract class FileIDGenerator extends java.lang.Object
A class to generate the File Identifier of a PDF document (the ID entry of the file trailer dictionary).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
FileIDGenerator.DigestFileIDGenerator
private static class
FileIDGenerator.RandomFileIDGenerator
-
Constructor Summary
Constructors Constructor Description FileIDGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (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[]
getOriginalFileID()
(package private) static FileIDGenerator
getRandomFileIDGenerator()
Use this method when the file ID is needed before the document is finalized.(package private) abstract byte[]
getUpdatedFileID()
-
-
-
Method Detail
-
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 java.security.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:
java.security.NoSuchAlgorithmException
- if the MD5 Digest algorithm is not available
-
-