Package com.pdftools.pdfa.validation
Class Validator
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.pdfa.validation.Validator
-
public class Validator extends NativeObject
The class to validate the standard conformance of documents
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Validator.Error
Report a validation issue found inanalyze(com.pdftools.pdf.Document)
orvalidate(com.pdftools.pdf.Document)
.static interface
Validator.ErrorListener
Listener interface for theValidator.Error
event.
-
Constructor Summary
Constructors Constructor Description Validator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addErrorListener(Validator.ErrorListener listener)
Add a listener for theValidator.Error
event.AnalysisResult
analyze(Document document)
Analyze a PDF document in preparation for its conversion to PDF/A.AnalysisResult
analyze(Document document, AnalysisOptions options)
Analyze a PDF document in preparation for its conversion to PDF/A.void
removeErrorListener(Validator.ErrorListener listener)
Remove registered listener for theValidator.Error
event.ValidationResult
validate(Document document)
Validate the standards conformance of a PDF document.ValidationResult
validate(Document document, ValidationOptions options)
Validate the standards conformance of a PDF document.-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
addErrorListener
public void addErrorListener(Validator.ErrorListener listener)
Add a listener for theValidator.Error
event.- Parameters:
listener
- Listener for theValidator.Error
event. If a listener is added that is already registered, it is ignored.
-
removeErrorListener
public void removeErrorListener(Validator.ErrorListener listener)
Remove registered listener for theValidator.Error
event.- Parameters:
listener
- Listener for theValidator.Error
event that should be removed. If the listener is not registered, it is ignored.
-
validate
public ValidationResult validate(Document document) throws LicenseException, ProcessingException
Validate the standards conformance of a PDF document.
- Parameters:
document
- The document to check the quality of- Returns:
- The result of the validation
- Throws:
LicenseException
- The license check has failed.ProcessingException
- The processing has failed.java.lang.IllegalArgumentException
- ifdocument
isnull
-
validate
public ValidationResult validate(Document document, ValidationOptions options) throws LicenseException, ProcessingException
Validate the standards conformance of a PDF document.
- Parameters:
document
- The document to check the quality ofoptions
- The options ornull
for default validation options- Returns:
- The result of the validation
- Throws:
LicenseException
- The license check has failed.ProcessingException
- The processing has failed.java.lang.IllegalArgumentException
- ifdocument
isnull
-
analyze
public AnalysisResult analyze(Document document) throws LicenseException
Analyze a PDF document in preparation for its conversion to PDF/A.
This method validates the document's standards conformance likevalidate(com.pdftools.pdf.Document)
. In addition to that, certain additional checks can be performed. However, the main difference is that the analysis result can be used inpdftools.pdfa.conversion.Converter.convert
to convert the PDF document to PDF/A.- Parameters:
document
- The document to analyze- Returns:
- The result of the analysis
- Throws:
LicenseException
- The license check has failed.java.lang.IllegalArgumentException
- The conformance of theoptions
argument is not PDF/A.java.lang.IllegalArgumentException
- ifdocument
isnull
-
analyze
public AnalysisResult analyze(Document document, AnalysisOptions options) throws LicenseException
Analyze a PDF document in preparation for its conversion to PDF/A.
This method validates the document's standards conformance likevalidate(com.pdftools.pdf.Document)
. In addition to that, certain additional checks can be performed. However, the main difference is that the analysis result can be used inpdftools.pdfa.conversion.Converter.convert
to convert the PDF document to PDF/A.- Parameters:
document
- The document to analyzeoptions
- The options ornull
for default analysis options- Returns:
- The result of the analysis
- Throws:
LicenseException
- The license check has failed.java.lang.IllegalArgumentException
- The conformance of theoptions
argument is not PDF/A.java.lang.IllegalArgumentException
- ifdocument
isnull
-
-