Class Converter.ConversionEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.pdftools.pdfa.conversion.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'scategory
. Review the suggested severity of eachEventCategory
and determine theEventSeverity
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 propertiesmessage
,context
, andpage
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.
-
Events of severity
- 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 occurredjava.lang.String
getDataPart()
The data part isnull
for the main file and a data part specification for embedded files.java.lang.String
getMessage()
The event messageint
getPageNo()
The page this event is associated to or0
EventSeverity
getSeverity()
The suggested severity of the event.
-
-
-
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 filefile.pdf
that is embedded in the main file. -
embedded-file:file1.pdf/embedded-file:file2.pdf
: For a filefile2.pdf
that is embedded in an embedded filefile1.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
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 bycategory
.
-
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 or0
-
-