public class PreflightDocument
extends org.apache.pdfbox.pdmodel.PDDocument
Constructor and Description |
---|
PreflightDocument(org.apache.pdfbox.cos.COSDocument doc,
Format format)
Create a preflight document based on the COSDocument and load the default configuration for the given format.
|
PreflightDocument(org.apache.pdfbox.cos.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.
|
Modifier and Type | Method and Description |
---|---|
void |
addValidationError(ValidationResult.ValidationError error)
Add a validation error.
|
void |
addValidationErrors(List<ValidationResult.ValidationError> errorList)
Add a list of validation errors.
|
PreflightContext |
getContext()
Returns the associated preflight context.
|
Format |
getSpecification()
Returns the format which is used to validate the pdf document.
|
List<ValidationResult.ValidationError> |
getValidationErrors()
Returns an unmodifiable list of all validation errors.
|
void |
setContext(PreflightContext context)
Set the preflight context for this document.
|
ValidationResult |
validate()
Check that PDDocument is a valid file according to the format given during the object creation.
|
addPage, addSignature, addSignature, addSignature, addSignature, close, getCurrentAccessPermission, getDocument, getDocumentCatalog, getDocumentId, getDocumentInformation, getEncryption, getLastSignatureDictionary, getNumberOfPages, getPage, getPages, getResourceCache, getSignatureDictionaries, getSignatureFields, getVersion, importPage, isAllSecurityToBeRemoved, isEncrypted, protect, registerTrueTypeFontForClosing, removePage, removePage, save, save, save, save, save, save, saveIncremental, saveIncremental, saveIncrementalForExternalSigning, setAllSecurityToBeRemoved, setDocumentId, setDocumentInformation, setEncryptionDictionary, setResourceCache, setVersion
public PreflightDocument(org.apache.pdfbox.cos.COSDocument doc, Format format)
doc
- the underlying COSDocumentformat
- the format used for validationpublic PreflightDocument(org.apache.pdfbox.cos.COSDocument doc, Format format, PreflightConfiguration config)
doc
- the underlying COSDocumentformat
- the format used for validationconfig
- the configuration used for validationpublic List<ValidationResult.ValidationError> getValidationErrors()
public void addValidationError(ValidationResult.ValidationError error)
error
- the validation error to be addedpublic void addValidationErrors(List<ValidationResult.ValidationError> errorList)
errorList
- the list of validation errorspublic PreflightContext getContext()
public void setContext(PreflightContext context)
context
- the associated preflight contextpublic ValidationResult validate() throws ValidationException
ValidationException
public Format getSpecification()
Copyright © 2002–2025 The Apache Software Foundation. All rights reserved.