Package org.verapdf.pdfa
Interface VeraPDFFoundry
-
- All Superinterfaces:
AutoCloseable,Closeable,Component
- All Known Implementing Classes:
AbstractFoundry
public interface VeraPDFFoundry extends Component
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PDFAValidatorcreateFailFastValidator(PDFAFlavour flavour, int maxFailures)Creates a newPDFAValidatorinitialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.PDFAValidatorcreateFailFastValidator(ValidationProfile profile, int maxFailures)Creates a newPDFAValidatorinitialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.MetadataFixercreateMetadataFixer()Obtain a newMetadataFixerinstance.PDFAParsercreateParser(File pdfFile)Method that returns a PDFParser instance, parsing file passed aspdfStreamparameter.PDFAParsercreateParser(File pdfFile, PDFAFlavour flavour)Method that returns a PDFParser instance, parsing file passed aspdfFileparameter.PDFAParsercreateParser(File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour)PDFAParsercreateParser(InputStream pdfStream)Method that returns a PDFParser instance, parsing the passedpdfStreamparameter.PDFAParsercreateParser(InputStream pdfStream, PDFAFlavour flavour)Method that returns a PDFParser instance, parsing the passedpdfStreamparameter.PDFAValidatorcreateValidator(PDFAFlavour flavour, boolean logSuccess)Creates a newPDFAValidatorinstance that uses one of theValidationProfiles packaged as a core library resource.PDFAValidatorcreateValidator(PDFAFlavour flavour, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages)PDFAValidatorcreateValidator(ValidationProfile profile, boolean logSuccess)Creates a newPDFAValidatorinitialised with the passed profile and chosen passed test logging.PDFAValidatorcreateValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages)PDFAValidatorcreateValidator(ValidatorConfig config)Obtain a newPDFAValidatorinstance.PDFAValidatorcreateValidator(ValidatorConfig config, PDFAFlavour flavour)Obtain a newPDFAValidatorinstance that uses a customPDFAFlavour.PDFAValidatorcreateValidator(ValidatorConfig config, ValidationProfile profile)Obtain a newPDFAValidatorinstance that uses a customValidationProfileinstance.PDFAFlavourdefaultFlavour()StringgetParserId()-
Methods inherited from interface org.verapdf.component.Component
getDetails
-
-
-
-
Method Detail
-
createParser
PDFAParser createParser(InputStream pdfStream) throws ModelParsingException, EncryptedPdfException
Method that returns a PDFParser instance, parsing the passedpdfStreamparameter. 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 passedpdfStreamparameter. 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(File pdfFile, PDFAFlavour flavour) throws ModelParsingException, EncryptedPdfException
Method that returns a PDFParser instance, parsing file passed aspdfFileparameter. 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) throws ModelParsingException, EncryptedPdfException
Method that returns a PDFParser instance, parsing file passed aspdfStreamparameter. 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
PDFAValidator createValidator(ValidatorConfig config)
Obtain a newPDFAValidatorinstance.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidator- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
PDFAValidator createValidator(ValidatorConfig config, ValidationProfile profile)
Obtain a newPDFAValidatorinstance that uses a customValidationProfileinstance.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidatorprofile-- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
PDFAValidator createValidator(ValidatorConfig config, PDFAFlavour flavour)
Obtain a newPDFAValidatorinstance that uses a customPDFAFlavour.- Parameters:
config- aValidatorConfiginstance used to configure thePDFAValidatorflavour- the particularPDFAFlavourto validated against.- Returns:
- an appropriately configured
PDFAValidatorinstance.
-
createValidator
PDFAValidator createValidator(PDFAFlavour flavour, boolean logSuccess)
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
PDFAValidator createValidator(ValidationProfile profile, boolean logSuccess)
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)
-
createValidator
PDFAValidator createValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logSuccess, boolean showErrorMessages)
-
createFailFastValidator
PDFAValidator createFailFastValidator(PDFAFlavour flavour, int maxFailures)
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(ValidationProfile profile, int maxFailures)
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()
- Returns:
- parser id
-
-