Class Validator


  • public class Validator
    extends NativeObject

    The class to validate the standard conformance of documents

    • Constructor Detail

      • Validator

        public Validator()
    • Method Detail

      • removeErrorListener

        public void removeErrorListener​(Validator.ErrorListener listener)
        Remove registered listener for the Validator.Error event.
        Parameters:
        listener - Listener for the Validator.Error event that should be removed. If the listener is not registered, it is ignored.
      • 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 like validate(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 in pdftools.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 the options argument is not PDF/A.
        java.lang.IllegalArgumentException - if document is null
      • 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 like validate(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 in pdftools.pdfa.conversion.Converter.convert to convert the PDF document to PDF/A.
        Parameters:
        document - The document to analyze
        options - The options or null for default analysis options
        Returns:
        The result of the analysis
        Throws:
        LicenseException - The license check has failed.
        java.lang.IllegalArgumentException - The conformance of the options argument is not PDF/A.
        java.lang.IllegalArgumentException - if document is null