Class Converter.ConversionEvent
- All Implemented Interfaces:
Serializable
- Enclosing class:
Converter
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
severitywhich is based on the event'scategory. Review the suggested severity of eachEventCategoryand determine theEventSeverityto 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 propertiesmessage,context, andpagein 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.
-
Events of severity
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThe category of the event.getCode()The code identifying particular events which can be used for detection and specialized handling of specific events.A description of the context where the event occurredThe data part isnullfor the main file and a data part specification for embedded files.The event messageintThe page this event is associated to or0The suggested severity of the event.Methods inherited from class java.util.EventObject
getSource, toString
-
Method Details
-
getDataPart
The data part is
nullfor the main file and a data part specification for embedded files.Examples:
-
embedded-file:file.pdf: For a filefile.pdfthat is embedded in the main file. -
embedded-file:file1.pdf/embedded-file:file2.pdf: For a filefile2.pdfthat is embedded in an embedded filefile1.pdf.
-
-
getMessage
The event message -
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.ConversionEventListenerfor a more detailed description. -
getCategory
The category of the event. This parameter can be used to:- Classify the severity of an event
- Specialized handling of events
Converter.ConversionEventListenerfor a more detailed description. -
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 bycategory. -
getContext
A description of the context where the event occurred -
getPageNo
public int getPageNo()The page this event is associated to or0
-