Package org.verapdf.pdfa
Interface VeraPDFFoundry
-
- All Superinterfaces:
AutoCloseable
,Closeable
,Component
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 PDFAValidator
createFailFastValidator(PDFAFlavour flavour, int maxFailures)
Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.PDFAValidator
createFailFastValidator(ValidationProfile profile, int maxFailures)
Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.MetadataFixer
createMetadataFixer()
Obtain a newMetadataFixer
instance.PDFAParser
createParser(File pdfFile)
Method that returns a PDFParser instance, parsing file passed aspdfStream
parameter.PDFAParser
createParser(File pdfFile, PDFAFlavour flavour)
Method that returns a PDFParser instance, parsing file passed aspdfFile
parameter.PDFAParser
createParser(File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour)
PDFAParser
createParser(InputStream pdfStream)
Method that returns a PDFParser instance, parsing the passedpdfStream
parameter.PDFAParser
createParser(InputStream pdfStream, PDFAFlavour flavour)
Method that returns a PDFParser instance, parsing the passedpdfStream
parameter.PDFAValidator
createValidator(PDFAFlavour flavour, boolean logSuccess)
Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource.PDFAValidator
createValidator(ValidationProfile profile, boolean logSuccess)
Creates a newPDFAValidator
initialised with the passed profile and chosen passed test logging.PDFAValidator
createValidator(ValidatorConfig config)
Obtain a newPDFAValidator
instance.PDFAValidator
createValidator(ValidatorConfig config, PDFAFlavour flavour)
Obtain a newPDFAValidator
instance that uses a customPDFAFlavour
.PDFAValidator
createValidator(ValidatorConfig config, ValidationProfile profile)
Obtain a newPDFAValidator
instance that uses a customValidationProfile
instance.PDFAFlavour
defaultFlavour()
String
getParserId()
-
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 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(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) throws ModelParsingException, EncryptedPdfException
Method that returns a PDFParser instance, parsing file passed aspdfStream
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
PDFAValidator createValidator(ValidatorConfig config)
Obtain a newPDFAValidator
instance.- Parameters:
config
- aValidatorConfig
instance used to configure thePDFAValidator
- Returns:
- an appropriately configured
PDFAValidator
instance.
-
createValidator
PDFAValidator createValidator(ValidatorConfig config, ValidationProfile profile)
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
PDFAValidator createValidator(ValidatorConfig config, PDFAFlavour flavour)
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
PDFAValidator createValidator(PDFAFlavour flavour, boolean logSuccess)
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
PDFAValidator createValidator(ValidationProfile profile, boolean logSuccess)
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
-
createFailFastValidator
PDFAValidator createFailFastValidator(PDFAFlavour flavour, int maxFailures)
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)
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
-
-