Package org.verapdf.pdfa
Interface VeraPDFFoundry
- All Superinterfaces:
AutoCloseable,Closeable,Component
- All Known Implementing Classes:
AbstractFoundry
The veraPDFFoundry interface provides methods for creating implementations of
the classes provided by a PDF Parser and Metadata Fixer implementations.
- Version:
- 0.1 Created 21 Sep 2016:12:37:55
- Author:
- Carl Wilson carlwilson AT github
-
Method Summary
Modifier and TypeMethodDescriptioncreateFailFastValidator(List<PDFAFlavour> flavours, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) createFailFastValidator(PDFAFlavour flavour, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) Creates a newPDFAValidatorinitialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.createFailFastValidator(ValidationProfile profile, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) Creates a newPDFAValidatorinitialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.Obtain a newMetadataFixerinstance.createParser(File pdfFile) Method that returns a PDFParser instance, parsing file passed as parameter.createParser(File pdfFile, PDFAFlavour flavour) Method that returns a PDFParser instance, parsing file passed as parameter.createParser(File pdfFile, PDFAFlavour flavour, String password) createParser(File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour) createParser(File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour, String password) createParser(InputStream pdfStream) Method that returns a PDFParser instance, parsing the passed parameter.createParser(InputStream pdfStream, PDFAFlavour flavour) Method that returns a PDFParser instance, parsing the passed parameter.createParser(InputStream pdfStream, PDFAFlavour flavour, String password) createParser(InputStream pdfStream, PDFAFlavour flavour, PDFAFlavour defaultFlavour) createParser(InputStream pdfStream, PDFAFlavour flavour, PDFAFlavour defaultFlavour, String password) createValidator(List<PDFAFlavour> flavours) Creates a newPDFAValidatorinstance that usesValidationProfiles packaged as a core library resource.createValidator(List<PDFAFlavour> flavour, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) createValidator(PDFAFlavour flavour, boolean logSuccess) Creates a newPDFAValidatorinstance that uses one of theValidationProfiles packaged as a core library resource.createValidator(PDFAFlavour flavour, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) createValidator(ValidationProfile profile, boolean logSuccess) Creates a newPDFAValidatorinitialised with the passed profile and chosen passed test logging.createValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) createValidator(ValidatorConfig config) Obtain a newPDFAValidatorinstance.createValidator(ValidatorConfig config, List<PDFAFlavour> flavours) Obtain a newPDFAValidatorinstance that uses the list of a customPDFAFlavours.createValidator(ValidatorConfig config, PDFAFlavour flavour) Obtain a newPDFAValidatorinstance that uses a customPDFAFlavour.createValidator(ValidatorConfig config, ValidationProfile profile) Obtain a newPDFAValidatorinstance that uses a customValidationProfileinstance.Methods inherited from interface org.verapdf.component.Component
getDetails
-
Method Details
-
createParser
Method that returns a PDFParser instance, parsing the passed parameter. The parser or parser provider will detect the flavour of the PDF document stream and provide an appropriate parser.- Parameters:
pdfStream-InputStreamfor the PDF document to be parsed.- Returns:
- a
PDFAParserinstance created from the supplied InputStream. - Throws:
ModelParsingException- when there's a problem parsing the PDF fileEncryptedPdfException- if the PDF to be parsed is encrypted
-
createParser
PDFAParser createParser(InputStream pdfStream, PDFAFlavour flavour) throws ModelParsingException, EncryptedPdfException Method that returns a PDFParser instance, parsing the passed parameter. The caller must explicitly state the flavour of the PDF document stream.- Parameters:
pdfStream-InputStreamfor the PDF document to be parsed.flavour- aPDFAFlavourinstance indicating parser configuration (PDF/A part and conformance level) to be assumed when parsing the document.- Returns:
- a
PDFAParserinstance created from the supplied InputStream. - Throws:
ModelParsingException- when there's a problem parsing the PDF fileEncryptedPdfException- if the PDF to be parsed is encrypted
-
createParser
PDFAParser createParser(InputStream pdfStream, PDFAFlavour flavour, PDFAFlavour defaultFlavour) throws ModelParsingException, EncryptedPdfException -
createParser
PDFAParser createParser(InputStream pdfStream, PDFAFlavour flavour, String password) throws ModelParsingException, EncryptedPdfException -
createParser
PDFAParser createParser(InputStream pdfStream, PDFAFlavour flavour, PDFAFlavour defaultFlavour, String password) throws ModelParsingException, EncryptedPdfException -
createParser
PDFAParser createParser(File pdfFile, PDFAFlavour flavour) throws ModelParsingException, EncryptedPdfException Method that returns a PDFParser instance, parsing file passed as parameter. The caller must explicitly state the flavour of the PDF document stream.- Parameters:
pdfFile-Filewith PDF document to be parsed.flavour- aPDFAFlavourinstance indicating parser configuration (PDF/A part and conformance level) to be assumed when parsing the document.- Returns:
- a
PDFAParserinstance created from the supplied InputStream. - Throws:
ModelParsingException- when there's a problem parsing the PDF fileEncryptedPdfException- if the PDF to be parsed is encrypted
-
createParser
PDFAParser createParser(File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour) throws ModelParsingException, EncryptedPdfException -
createParser
PDFAParser createParser(File pdfFile, PDFAFlavour flavour, String password) throws ModelParsingException, EncryptedPdfException -
createParser
PDFAParser createParser(File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour, String password) throws ModelParsingException, EncryptedPdfException -
createParser
Method that returns a PDFParser instance, parsing file passed as parameter. The parser or parser provider will detect the flavour of the PDF document stream and provide an appropriate parser.- Parameters:
pdfFile-Filewith the PDF document to be parsed.- Returns:
- a
PDFAParserinstance created from the supplied InputStream. - Throws:
ModelParsingException- when there's a problem parsing the PDF fileEncryptedPdfException- if the PDF to be parsed is encrypted
-
createValidator
Obtain a newPDFAValidatorinstance.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidator- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
Obtain a newPDFAValidatorinstance that uses a customValidationProfileinstance.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidatorprofile-- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
Obtain a newPDFAValidatorinstance that uses a customPDFAFlavour.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidatorflavour- the particularPDFAFlavourto validated against.- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
Obtain a newPDFAValidatorinstance that uses the list of a customPDFAFlavours.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidatorflavours- the list of particularPDFAFlavours to validated against.- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
Creates a newPDFAValidatorinstance that uses one of theValidationProfiles packaged as a core library resource. While these profiles are not guaranteed to be up to date, they are available when offline. AProfileDirectorypopulated with the pre-loaded profiles can be obtained by callingProfiles.getVeraProfileDirectory().- Parameters:
flavour- thePDFAFlavourthat's associated with theValidationProfileto used to initialise thePDFAValidator.logSuccess-booleanused to configure logging of passed tests by thePDFAValidator. Passtrueto log passed tests,falseto only log tests that don't pass.- Returns:
- a
PDFAValidatorinstance initialised from the passed parameters
-
createValidator
Creates a newPDFAValidatorinstance that usesValidationProfiles packaged as a core library resource. While these profiles are not guaranteed to be up to date, they are available when offline. AProfileDirectorypopulated with the pre-loaded profiles can be obtained by callingProfiles.getVeraProfileDirectory().- Parameters:
flavours- list of thePDFAFlavourthat are associated with theValidationProfileto used to initialise thePDFAValidator.- Returns:
- a
PDFAValidatorinstance initialised from the passed parameters
-
createValidator
Creates a newPDFAValidatorinitialised with the passed profile and chosen passed test logging.- Parameters:
profile- theValidationProfileto be enforced by the returnedPDFAValidator.logSuccess-booleanused to configure logging of passed tests by thePDFAValidator. Passtrueto log passed tests,falseto only log tests that don't pass.- Returns:
- a
PDFAValidatorinstance initialised from the passed parameters
-
createValidator
PDFAValidator createValidator(PDFAFlavour flavour, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) -
createValidator
PDFAValidator createValidator(List<PDFAFlavour> flavour, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) -
createValidator
PDFAValidator createValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) -
createFailFastValidator
PDFAValidator createFailFastValidator(PDFAFlavour flavour, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) Creates a newPDFAValidatorinitialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.- Parameters:
flavour- thePDFAFlavourthat's associated with theValidationProfileto used to initialise thePDFAValidator.maxFailures- anintvalue that configures thePDFAValidatorto abort validation aftermaxFailuresfailed tests. IfmaxFailuresis less than 1 then thePDFAValidatorwill complete the full validation process.- Returns:
- a
PDFAValidatorinstance initialised from the passed parameters
-
createFailFastValidator
PDFAValidator createFailFastValidator(List<PDFAFlavour> flavours, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) -
createFailFastValidator
PDFAValidator createFailFastValidator(ValidationProfile profile, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) Creates a newPDFAValidatorinitialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.- Parameters:
profile- theValidationProfileto be enforced by the returnedPDFAValidator.maxFailures- anintvalue that configures thePDFAValidatorto abort validation aftermaxFailuresfailed tests. IfmaxFailuresis less than 1 then thePDFAValidatorwill complete the full validation process.- Returns:
- a
PDFAValidatorinstance initialised from the passed parameters
-
createMetadataFixer
MetadataFixer createMetadataFixer()Obtain a newMetadataFixerinstance.- Returns:
- a
MetadataFixerinstance.
-
defaultFlavour
PDFAFlavour defaultFlavour()- Returns:
- the default
PDFAFlavourset for thisVeraPDFFoundry
-
getParserId
String getParserId()
-