Class PDFDocumentImpl
java.lang.Object
org.verapdf.metadata.fixer.gf.impl.model.PDFDocumentImpl
- All Implemented Interfaces:
PDFDocument
- Author:
- Maksim Bezrukov
-
Constructor Summary
ConstructorDescriptionPDFDocumentImpl
(InputStream pdfStream) Create a new PDFDocumentImpl from the passed InputStreamPDFDocumentImpl
(PDDocument document) -
Method Summary
Modifier and TypeMethodDescriptionReturn pdf document information dictionary representation.Return pdf document metadata representation.boolean
Implemented by GreenField library.int
Removes filters for all metadata streams in documentsaveDocumentIncremental
(MetadataFixerResult.RepairStatus status, OutputStream output, PDFAFlavour flavour) Incremental save of pdf document.
-
Constructor Details
-
PDFDocumentImpl
Create a new PDFDocumentImpl from the passed InputStream- Parameters:
pdfStream
- anInputStream
to be parsed as a PDF Document.- Throws:
IOException
- when there's a problem reading or parsing the file.
-
PDFDocumentImpl
- Parameters:
document
-
-
-
Method Details
-
getMetadata
Return pdf document metadata representation. Must return null if and only if handler having problems with metadata obtain (exceptions, for example). If metadata is not present in the document ('Metadata' key in catalog not present or empty) it`s must be added. Implemented by GreenField library.- Specified by:
getMetadata
in interfacePDFDocument
- Returns:
- metadata representation or null
- See Also:
-
getInfoDictionary
Return pdf document information dictionary representation. Must be not null (empty, for example). Implemented by GreenField library.- Specified by:
getInfoDictionary
in interfacePDFDocument
- Returns:
- information dictionary representation
- See Also:
-
isNeedToBeUpdated
public boolean isNeedToBeUpdated()Implemented by GreenField library.- Specified by:
isNeedToBeUpdated
in interfacePDFDocument
- Returns:
-
saveDocumentIncremental
public MetadataFixerResult saveDocumentIncremental(MetadataFixerResult.RepairStatus status, OutputStream output, PDFAFlavour flavour) Incremental save of pdf document. Document must be saved if and only if metadata or information dictionary of document was changed. InMetadataFixerResultImpl
must set 1 of 3 states:-
MetadataFixerResult.RepairStatus.FIX_ERROR
if got problems with document save -
MetadataFixerResult.RepairStatus.NO_ACTION
if metadata and information dictionary was not changed -
MetadataFixerResult.RepairStatus.SUCCESS
if document save successful
- Specified by:
saveDocumentIncremental
in interfacePDFDocument
output
- output stream for document save- Returns:
-
-
removeFiltersForAllMetadataObjects
public int removeFiltersForAllMetadataObjects()Description copied from interface:PDFDocument
Removes filters for all metadata streams in document- Specified by:
removeFiltersForAllMetadataObjects
in interfacePDFDocument
- Returns:
- number of unfiltered streams
-