Package org.apache.pdfbox.preflight
Class PreflightDocument
java.lang.Object
org.apache.pdfbox.pdmodel.PDDocument
org.apache.pdfbox.preflight.PreflightDocument
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PreflightConfigurationprivate PreflightContextprivate ValidationResultprivate final Format -
Constructor Summary
ConstructorsConstructorDescriptionPreflightDocument(COSDocument doc, Format format) Create a preflight document based on the COSDocument and load the default configuration for the given format.PreflightDocument(COSDocument doc, Format format, PreflightConfiguration config) Create a preflight document based on the COSDocument that will use the given configuration bean to process the validation.PreflightDocument(Format format) Create an empty preflight document and load the default configuration for the given format.PreflightDocument(Format format, PreflightConfiguration cfg) Create an empty preflight document that will use the given configuration bean to process the validation. -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns the format which is used to validate the pdf document.private voidinitConfiguration(Format format) voidsetContext(PreflightContext context) voidsetResult(ValidationResult result) voidvalidate()Check that PDDocument is a valid file according to the format given during the object creation.Methods inherited from class org.apache.pdfbox.pdmodel.PDDocument
addPage, addSignature, addSignature, addSignature, addSignature, addSignatureField, close, getCurrentAccessPermission, getDocument, getDocumentCatalog, getDocumentId, getDocumentInformation, getEncryption, getLastSignatureDictionary, getNumberOfPages, getPage, getPages, getResourceCache, getSignatureDictionaries, getSignatureFields, getVersion, importPage, isAllSecurityToBeRemoved, isEncrypted, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, protect, registerTrueTypeFontForClosing, removePage, removePage, save, save, save, saveIncremental, saveIncremental, saveIncrementalForExternalSigning, setAllSecurityToBeRemoved, setDocumentId, setDocumentInformation, setEncryptionDictionary, setResourceCache, setVersion
-
Field Details
-
result
-
config
-
context
-
specification
-
-
Constructor Details
-
PreflightDocument
Create an empty preflight document and load the default configuration for the given format.- Parameters:
format-- Throws:
IOException
-
PreflightDocument
Create a preflight document based on the COSDocument and load the default configuration for the given format.- Parameters:
doc-format-
-
PreflightDocument
Create an empty preflight document that will use the given configuration bean to process the validation. if the configuration is null, a default configuration will be load using the given format.- Parameters:
format-cfg-- Throws:
IOException
-
PreflightDocument
Create a preflight document based on the COSDocument that will use the given configuration bean to process the validation. if the configuration is null, a default configuration will be load using the given format.- Parameters:
doc-format-config-
-
-
Method Details
-
initConfiguration
-
getResult
-
setResult
-
addValidationError
-
getContext
-
setContext
-
validate
Check that PDDocument is a valid file according to the format given during the object creation.- Throws:
ValidationException
-
getSpecification
Returns the format which is used to validate the pdf document.- Returns:
- the format used for validation
-