Class Converter.ConversionEvent

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    Converter

    public class Converter.ConversionEvent
    extends java.util.EventObject

    The event for errors, warnings, and informational messages that occur during conversion

    Report a conversion event that occurred in Converter.convert(com.pdftools.pdfa.validation.AnalysisResult, com.pdftools.pdf.Document, com.pdftools.sys.Stream). These events can be used to:

    • Generate a detailed conversion report.
    • Detect and handle critical conversion events.

    Note that if a document cannot be converted to the requested conformance, the Converter.convert(com.pdftools.pdfa.validation.AnalysisResult, com.pdftools.pdf.Document, com.pdftools.sys.Stream) throws an exception. However, even if the output document meets all required standards, the conversion might have resulted in differences that might be acceptable in some processes but not in others. Such potentially critical conversion issues are reported as conversion events.

    We suggest checking which conversion events can be tolerated in your conversion process and which must be considered critical:

    • Review the suggested severity of events. Each event has a default severity indicated by severity which is based on the event's category. Review the suggested severity of each EventCategory and determine the EventSeverity to be used in your process.
    • Handle events according to their severity.
      • Events of severity EventSeverity.ERROR: The conversion must be considered as failed.
      • Events of severity EventSeverity.WARNING: In case of a warning, the output file is best presented to a user to decide if the result is acceptable. The properties message, context, and page in combination with the output file are helpful to make this decision.

        If a manual review is not feasible, critical warnings should be classified as an EventSeverity.ERROR. An exception to this is, if all processed input documents are similar in their content, e.g. because they have been created by a single source (application). In this case, the conversion result can be verified using representative test files and the event severity chosen accordingly.

      • Events of severity EventSeverity.INFORMATION: No further action is required.

    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      EventCategory getCategory()
      The category of the event.
      EventCode getCode()
      The code identifying particular events which can be used for detection and specialized handling of specific events.
      java.lang.String getContext()
      A description of the context where the event occurred
      java.lang.String getDataPart()
      The data part is null for the main file and a data part specification for embedded files.
      java.lang.String getMessage()
      The event message
      int getPageNo()
      The page this event is associated to or 0
      EventSeverity getSeverity()
      The suggested severity of the event.
      • Methods inherited from class java.util.EventObject

        getSource, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getDataPart

        public java.lang.String getDataPart()

        The data part is null for the main file and a data part specification for embedded files.

        Examples:

        • embedded-file:file.pdf: For a file file.pdf that is embedded in the main file.
        • embedded-file:file1.pdf/embedded-file:file2.pdf: For a file file2.pdf that is embedded in an embedded file file1.pdf.

      • getMessage

        public java.lang.String getMessage()
        The event message
      • getSeverity

        public EventSeverity getSeverity()

        The suggested severity of the event.

        We suggest checking, which conversion events are tolerable in your conversion process and which must be considered critical. See the documentation of Converter.ConversionEventListener for a more detailed description.

      • getCategory

        public EventCategory getCategory()
        The category of the event. This parameter can be used to:
        • Classify the severity of an event
        • Specialized handling of events
        See the documentation of Converter.ConversionEventListener for a more detailed description.
      • getCode

        public EventCode getCode()
        The code identifying particular events which can be used for detection and specialized handling of specific events. For most applications, it suffices to handle events by category.
      • getContext

        public java.lang.String getContext()
        A description of the context where the event occurred
      • getPageNo

        public int getPageNo()
        The page this event is associated to or 0