Class PDFDocumentImpl
java.lang.Object
org.verapdf.metadata.fixer.gf.impl.model.PDFDocumentImpl
- All Implemented Interfaces:
PDFDocument
- Author:
- Maksim Bezrukov
-
Constructor Summary
ConstructorsConstructorDescriptionPDFDocumentImpl(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.booleanImplemented by GreenField library.intRemoves 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- anInputStreamto 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:
getMetadatain 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:
getInfoDictionaryin interfacePDFDocument- Returns:
- information dictionary representation
- See Also:
-
isNeedToBeUpdated
public boolean isNeedToBeUpdated()Implemented by GreenField library.- Specified by:
isNeedToBeUpdatedin 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. InMetadataFixerResultImplmust set 1 of 3 states:-
MetadataFixerResult.RepairStatus.FIX_ERRORif got problems with document save -
MetadataFixerResult.RepairStatus.NO_ACTIONif metadata and information dictionary was not changed -
MetadataFixerResult.RepairStatus.SUCCESSif document save successful
- Specified by:
saveDocumentIncrementalin interfacePDFDocumentoutput- output stream for document save- Returns:
-
-
removeFiltersForAllMetadataObjects
public int removeFiltersForAllMetadataObjects()Description copied from interface:PDFDocumentRemoves filters for all metadata streams in document- Specified by:
removeFiltersForAllMetadataObjectsin interfacePDFDocument- Returns:
- number of unfiltered streams
-