public class PreflightContext
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
private PreflightConfiguration |
config |
private java.lang.Integer |
currentPageNumber |
private javax.activation.DataSource |
dataSource
The datasource to load the document from.
|
private PreflightDocument |
document
The PDFbox object representation of the PDF source.
|
private long |
fileLen |
private java.util.Map<COSBase,FontContainer<?>> |
fontContainers
Contains the list of font name embedded in the PDF document.
|
private boolean |
iccProfileAlreadySearched |
private ICCProfileWrapper |
iccProfileWrapper
This wrapper contains the ICCProfile used by the PDF file.
|
private XMPMetadata |
metadata
MetaData of the current pdf file.
|
private java.util.Set<COSObjectable> |
processedSet |
private PreflightPath |
validationPath |
private XrefTrailerResolver |
xrefTrailerResolver
Contains all Xref/trailer objects and resolves them into single object using startxref reference.
|
Constructor and Description |
---|
PreflightContext(javax.activation.DataSource dataSource)
Create the DocumentHandler using the DataSource which represent the PDF file to check.
|
PreflightContext(javax.activation.DataSource dataSource,
PreflightConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
addFontContainer(COSBase cBase,
FontContainer<?> fc)
Add a FontContainer to allow TextObject validation.
|
void |
addToProcessedSet(COSObjectable cos)
Add the argument to the set of processed elements,
|
void |
addValidationError(ValidationResult.ValidationError error)
Add the given error the PreflightDocument
|
void |
addValidationErrors(java.util.List<ValidationResult.ValidationError> errors)
Add the given errors the PreflightDocument
|
void |
close()
Close all opened resources
|
PreflightConfiguration |
getConfig() |
java.lang.Integer |
getCurrentPageNumber()
Returns the current page number or null if none is known.
|
PreflightDocument |
getDocument() |
long |
getFileLen() |
FontContainer<?> |
getFontContainer(COSBase cBase)
Return the FontContainer identified by the COSBase.
|
ICCProfileWrapper |
getIccProfileWrapper() |
XMPMetadata |
getMetadata() |
javax.activation.DataSource |
getSource() |
PreflightPath |
getValidationPath() |
XrefTrailerResolver |
getXrefTrailerResolver() |
boolean |
isComplete() |
boolean |
isIccProfileAlreadySearched() |
boolean |
isInProcessedSet(COSObjectable cos)
Tell if the argument is in the set of processed elements.
|
void |
setConfig(PreflightConfiguration config) |
void |
setCurrentPageNumber(java.lang.Integer currentPageNumber)
Sets or resets the current page number.
|
void |
setDocument(PreflightDocument document)
Initialize the PDFBox object which present the PDF File.
|
void |
setFileLen(long fileLen) |
void |
setIccProfileAlreadySearched(boolean iccProfileAlreadySearched) |
void |
setIccProfileWrapper(ICCProfileWrapper iccProfileWrapper) |
void |
setMetadata(XMPMetadata metadata) |
void |
setValidationPath(PreflightPath validationPath) |
void |
setXrefTrailerResolver(XrefTrailerResolver xrefTrailerResolver) |
private final java.util.Map<COSBase,FontContainer<?>> fontContainers
private PreflightDocument document
private javax.activation.DataSource dataSource
private XrefTrailerResolver xrefTrailerResolver
private ICCProfileWrapper iccProfileWrapper
private boolean iccProfileAlreadySearched
private XMPMetadata metadata
private PreflightConfiguration config
private PreflightPath validationPath
private final java.util.Set<COSObjectable> processedSet
private java.lang.Integer currentPageNumber
private long fileLen
public PreflightContext(javax.activation.DataSource dataSource)
dataSource
- public PreflightContext(javax.activation.DataSource dataSource, PreflightConfiguration configuration)
public XMPMetadata getMetadata()
public void setMetadata(XMPMetadata metadata)
metadata
- the metadata to setpublic PreflightDocument getDocument()
public XrefTrailerResolver getXrefTrailerResolver()
public void setXrefTrailerResolver(XrefTrailerResolver xrefTrailerResolver)
public void setDocument(PreflightDocument document)
document
- public javax.activation.DataSource getSource()
public boolean isComplete()
public void addFontContainer(COSBase cBase, FontContainer<?> fc)
cBase
- the COSBase for the font container.fc
- the font container.public FontContainer<?> getFontContainer(COSBase cBase)
fontContainers
map, the null value is returned.cBase
- the COSBase for the font containerpublic ICCProfileWrapper getIccProfileWrapper()
public void setIccProfileWrapper(ICCProfileWrapper iccProfileWrapper)
iccProfileWrapper
- the iccProfileWrapper to setpublic PreflightConfiguration getConfig()
public void setConfig(PreflightConfiguration config)
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public void addValidationError(ValidationResult.ValidationError error)
error
- public void addValidationErrors(java.util.List<ValidationResult.ValidationError> errors)
errors
- the list of validation errors.public PreflightPath getValidationPath()
public void setValidationPath(PreflightPath validationPath)
public boolean isIccProfileAlreadySearched()
public void setIccProfileAlreadySearched(boolean iccProfileAlreadySearched)
public void setCurrentPageNumber(java.lang.Integer currentPageNumber)
currentPageNumber
- zero based page number or null if none is known.public java.lang.Integer getCurrentPageNumber()
public void setFileLen(long fileLen)
public long getFileLen()
public void addToProcessedSet(COSObjectable cos)
cos
- public boolean isInProcessedSet(COSObjectable cos)
cos
-