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
(PDFAFlavour flavour, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) Creates a newPDFAValidator
initialised 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 newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.Obtain a newMetadataFixer
instance.createParser
(File pdfFile) Method that returns a PDFParser instance, parsing file passed aspdfFile
parameter.createParser
(File pdfFile, PDFAFlavour flavour) Method that returns a PDFParser instance, parsing file passed aspdfFile
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 passedpdfStream
parameter.createParser
(InputStream pdfStream, PDFAFlavour flavour) Method that returns a PDFParser instance, parsing the passedpdfStream
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
(PDFAFlavour flavour, boolean logSuccess) Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource.createValidator
(PDFAFlavour flavour, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) createValidator
(ValidationProfile profile, boolean logSuccess) Creates a newPDFAValidator
initialised 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 newPDFAValidator
instance.createValidator
(ValidatorConfig config, PDFAFlavour flavour) Obtain a newPDFAValidator
instance that uses a customPDFAFlavour
.createValidator
(ValidatorConfig config, ValidationProfile profile) Obtain a newPDFAValidator
instance that uses a customValidationProfile
instance.Methods inherited from interface org.verapdf.component.Component
getDetails
-
Method Details
-
createParser
Method that returns a PDFParser instance, parsing the passedpdfStream
parameter. The parser or parser provider will detect the flavour of the PDF document stream and provide an appropriate parser.- Parameters:
pdfStream
-InputStream
for the PDF document to be parsed.- Returns:
- a
PDFAParser
instance 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 passedpdfStream
parameter. The caller must explicitly state the flavour of the PDF document stream.- Parameters:
pdfStream
-InputStream
for the PDF document to be parsed.flavour
- aPDFAFlavour
instance indicating parser configuration (PDF/A part and conformance level) to be assumed when parsing the document.- Returns:
- a
PDFAParser
instance 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 aspdfFile
parameter. The caller must explicitly state the flavour of the PDF document stream.- Parameters:
pdfFile
-File
with PDF document to be parsed.flavour
- aPDFAFlavour
instance indicating parser configuration (PDF/A part and conformance level) to be assumed when parsing the document.- Returns:
- a
PDFAParser
instance 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 aspdfFile
parameter. The parser or parser provider will detect the flavour of the PDF document stream and provide an appropriate parser.- Parameters:
pdfFile
-File
with the PDF document to be parsed.- Returns:
- a
PDFAParser
instance 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 newPDFAValidator
instance.- Parameters:
config
- aValidatorConfig
instance used to configure thePDFAValidator
- Returns:
- an appropriately configured
PDFAValidator
instance.
-
createValidator
Obtain a newPDFAValidator
instance that uses a customValidationProfile
instance.- Parameters:
config
- aValidatorConfig
instance used to configure thePDFAValidator
profile
-- Returns:
- an appropriately configured
PDFAValidator
instance.
-
createValidator
Obtain a newPDFAValidator
instance that uses a customPDFAFlavour
.- Parameters:
config
- aValidatorConfig
instance used to configure thePDFAValidator
flavour
- the particularPDFAFlavour
to validated against.- Returns:
- an appropriately configured
PDFAValidator
instance.
-
createValidator
Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource. While these profiles are not guaranteed to be up to date, they are available when offline. AProfileDirectory
populated with the pre-loaded profiles can be obtained by callingProfiles#getVeraProfileDirectory()
.- Parameters:
flavour
- thePDFAFlavour
that's associated with theValidationProfile
to used to initialise thePDFAValidator
.logSuccess
-boolean
used to configure logging of passed tests by thePDFAValidator
. Passtrue
to log passed tests,false
to only log tests that don't pass.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
Creates a newPDFAValidator
initialised with the passed profile and chosen passed test logging.- Parameters:
profile
- theValidationProfile
to be enforced by the returnedPDFAValidator
.logSuccess
-boolean
used to configure logging of passed tests by thePDFAValidator
. Passtrue
to log passed tests,false
to only log tests that don't pass.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
PDFAValidator createValidator(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 newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.- Parameters:
flavour
- thePDFAFlavour
that's associated with theValidationProfile
to used to initialise thePDFAValidator
.maxFailures
- anint
value that configures thePDFAValidator
to abort validation aftermaxFailures
failed tests. IfmaxFailures
is less than 1 then thePDFAValidator
will complete the full validation process.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createFailFastValidator
PDFAValidator createFailFastValidator(ValidationProfile profile, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages, boolean showProgress) Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.- Parameters:
profile
- theValidationProfile
to be enforced by the returnedPDFAValidator
.maxFailures
- anint
value that configures thePDFAValidator
to abort validation aftermaxFailures
failed tests. IfmaxFailures
is less than 1 then thePDFAValidator
will complete the full validation process.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createMetadataFixer
MetadataFixer createMetadataFixer()Obtain a newMetadataFixer
instance.- Returns:
- a
MetadataFixer
instance.
-
defaultFlavour
PDFAFlavour defaultFlavour()- Returns:
- the default
PDFAFlavour
set for thisVeraPDFFoundry
-
getParserId
String getParserId()- Returns:
- parser id
-