Package com.itextpdf.pdf2data
Class RecognitionResultHolder
java.lang.Object
com.itextpdf.pdf2data.RecognitionResultHolder
Recognition result holder with methods to operate with the results.
-
Constructor Summary
ConstructorDescriptionCreates an instance with specified result. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve result object.static RecognitionResultHolder
Reads result from input stream containing the recognition result in JSON format.void
writeToJson
(File outputJson) Writes holded result into the specified file as JSON.void
writeToJson
(File outputJson, SerializationProperties properties) Writes holded result into the specified file as JSON.void
writeToJson
(OutputStream jsonOutputStream) Writes holded result into the specified output stream as JSON.void
writeToJson
(OutputStream jsonOutputStream, SerializationProperties properties) Writes holded result into the specified output stream as JSON.void
writeToXml
(File outputXml) Saves recognition results to provided xml file.void
writeToXml
(File outputXml, SerializationProperties properties) Saves recognition results to provided xml file.void
writeToXml
(OutputStream xmlOutputStream) Saves recognition results to output stream in xml form.void
writeToXml
(OutputStream xmlOutputStream, SerializationProperties properties) Saves recognition results to output stream in xml form.
-
Constructor Details
-
RecognitionResultHolder
Creates an instance with specified result.- Parameters:
-
result
- recognition result to be used in holder
-
-
Method Details
-
readFromJson
Reads result from input stream containing the recognition result in JSON format.- Parameters:
-
is
- theInputStream
to read from - Returns:
-
an instance of
RecognitionResultHolder
based on the read result - Throws:
-
InvalidResultException
- if the read result has invalid schema version
-
getResult
Retrieve result object.- Returns:
-
RecognitionResult
instance
-
writeToJson
Writes holded result into the specified file as JSON.- Parameters:
-
outputJson
- theFile
to write into - Throws:
-
IOException
- if any I/O exception occurs
-
writeToJson
Writes holded result into the specified file as JSON.- Parameters:
-
outputJson
- theFile
to write into -
properties
- serialization properties - Throws:
-
IOException
- if any I/O exception occurs
-
writeToJson
Writes holded result into the specified output stream as JSON.- Parameters:
-
jsonOutputStream
- theOutputStream
to write into
-
writeToJson
Writes holded result into the specified output stream as JSON.- Parameters:
-
jsonOutputStream
- theOutputStream
to write into -
properties
- serialization properties
-
writeToXml
Saves recognition results to provided xml file.- Parameters:
-
outputXml
- xml file - Throws:
-
IOException
- if any I/O exception occurs
-
writeToXml
Saves recognition results to provided xml file.- Parameters:
-
outputXml
- output stream -
properties
- aSerializationProperties
instance - Throws:
-
IOException
- if any I/O exception occurs
-
writeToXml
Saves recognition results to output stream in xml form.- Parameters:
-
xmlOutputStream
- output stream - Throws:
-
IOException
- if any I/O exception occurs
-
writeToXml
public void writeToXml(OutputStream xmlOutputStream, SerializationProperties properties) throws IOException Saves recognition results to output stream in xml form.- Parameters:
-
xmlOutputStream
- output stream -
properties
- aSerializationProperties
instance - Throws:
-
IOException
- if any I/O exception occurs
-