Class PreflightContext
java.lang.Object
org.apache.pdfbox.preflight.PreflightContext
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionCreate the DocumentHandler using the DataSource which represent the PDF file to check.PreflightContext(PreflightConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFontContainer(org.apache.pdfbox.cos.COSBase cBase, FontContainer<?> fc) Add a FontContainer to allow TextObject validation.voidaddToProcessedSet(org.apache.pdfbox.pdmodel.common.COSObjectable cos) Add the argument to the set of processed elements,voidAdd the given error the PreflightDocumentvoidAdd the given errors the PreflightDocumentvoidclose()Close all opened resourcesReturns the current page number or null if none is known.longgetFontContainer(org.apache.pdfbox.cos.COSBase cBase) Return the FontContainer identified by the COSBase.org.apache.xmpbox.XMPMetadataorg.apache.pdfbox.pdfparser.XrefTrailerResolverbooleanbooleanisInProcessedSet(org.apache.pdfbox.pdmodel.common.COSObjectable cos) Tell if the argument is in the set of processed elements.voidsetConfig(PreflightConfiguration config) voidsetCurrentPageNumber(Integer currentPageNumber) Sets or resets the current page number.voidsetDocument(PreflightDocument document) Initialize the PDFBox object which present the PDF File.voidsetFileLen(long fileLen) voidsetIccProfileAlreadySearched(boolean iccProfileAlreadySearched) voidsetIccProfileWrapper(ICCProfileWrapper iccProfileWrapper) voidsetMetadata(org.apache.xmpbox.XMPMetadata metadata) voidsetValidationPath(PreflightPath validationPath) voidsetXrefTrailerResolver(org.apache.pdfbox.pdfparser.XrefTrailerResolver xrefTrailerResolver)
-
Constructor Details
-
PreflightContext
public PreflightContext()Create the DocumentHandler using the DataSource which represent the PDF file to check. -
PreflightContext
-
-
Method Details
-
getMetadata
public org.apache.xmpbox.XMPMetadata getMetadata()- Returns:
- the metadata
-
setMetadata
public void setMetadata(org.apache.xmpbox.XMPMetadata metadata) - Parameters:
metadata- the metadata to set
-
getDocument
- Returns:
- the PDFBox object representation of the document
-
getXrefTrailerResolver
public org.apache.pdfbox.pdfparser.XrefTrailerResolver getXrefTrailerResolver() -
setXrefTrailerResolver
public void setXrefTrailerResolver(org.apache.pdfbox.pdfparser.XrefTrailerResolver xrefTrailerResolver) -
setDocument
Initialize the PDFBox object which present the PDF File.- Parameters:
document-
-
addFontContainer
Add a FontContainer to allow TextObject validation.- Parameters:
cBase- the COSBase for the font container.fc- the font container.
-
getFontContainer
Return the FontContainer identified by the COSBase. If the given object is missing from thefontContainersmap, the null value is returned.- Parameters:
cBase- the COSBase for the font container- Returns:
- the font container.
-
getIccProfileWrapper
- Returns:
- the iccProfileWrapper
-
setIccProfileWrapper
- Parameters:
iccProfileWrapper- the iccProfileWrapper to set
-
getConfig
-
setConfig
-
close
public void close()Close all opened resources- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
addValidationError
Add the given error the PreflightDocument- Parameters:
error-
-
addValidationErrors
Add the given errors the PreflightDocument- Parameters:
errors- the list of validation errors.
-
getValidationPath
-
setValidationPath
-
isIccProfileAlreadySearched
public boolean isIccProfileAlreadySearched() -
setIccProfileAlreadySearched
public void setIccProfileAlreadySearched(boolean iccProfileAlreadySearched) -
setCurrentPageNumber
Sets or resets the current page number.- Parameters:
currentPageNumber- zero based page number or null if none is known.
-
getCurrentPageNumber
Returns the current page number or null if none is known. -
setFileLen
public void setFileLen(long fileLen) -
getFileLen
public long getFileLen() -
addToProcessedSet
public void addToProcessedSet(org.apache.pdfbox.pdmodel.common.COSObjectable cos) Add the argument to the set of processed elements,- Parameters:
cos-
-
isInProcessedSet
public boolean isInProcessedSet(org.apache.pdfbox.pdmodel.common.COSObjectable cos) Tell if the argument is in the set of processed elements.- Parameters:
cos-- Returns:
- true if in the set, false if not.
-