public class Converter.ConversionEvent
extends java.util.EventObject
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:
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:
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.
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.
EventSeverity.INFORMATION
:
No further action is required.
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.
|
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
.public java.lang.String getMessage()
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.
public EventCategory getCategory()
Converter.ConversionEventListener
for a more detailed description.public EventCode getCode()
category
.public java.lang.String getContext()
public int getPageNo()
0