Class Result
The Result
class represents the result of a PDFreactor
conversion.
-
Method Summary
Modifier and TypeMethodDescriptionProvides a log about all URL connections attempted by PDFreactor, including information about HTTP request and result, should the connection be an HTTP or HTTPS connection.Returns the name of the conversion if it was specified viaConfiguration.setConversionName(String)
.byte[]
Returns the converted PDF or image.byte[][]
Returns the converted multi-page image, only ifConfiguration.OutputFormat.setMultiImage(Boolean)
was set totrue
andConfiguration.setOutputFormat(com.realobjects.pdfreactor.Configuration.OutputFormat)
was set to an image format, otherwise it returnsnull
.Provides information about content exceeding its page or parent.Returns data that has been exported from document JavaScript viaro.exports
if set,null
otherwise.getLog()
Returns theLog
of the conversion.Provides information about resources that could not be loaded during the conversion.int
Returns the number of pages of the laid out input document after conversion.int
Returns the number of pages of the resulting PDF.
-
Method Details
-
getDocument
public byte[] getDocument()Returns the converted PDF or image.
If the conversion was not successful or if the resulting PDF or image has been written directly into an
OutputStream
via thePDFreactor.convert(Configuration, OutputStream)
method, this returnsnull
. -
getDocumentArray
public byte[][] getDocumentArray()Returns the converted multi-page image, only if
Configuration.OutputFormat.setMultiImage(Boolean)
was set totrue
andConfiguration.setOutputFormat(com.realobjects.pdfreactor.Configuration.OutputFormat)
was set to an image format, otherwise it returnsnull
. -
getNumberOfPages
public int getNumberOfPages()Returns the number of pages of the laid out input document after conversion.
-
getNumberOfPagesLiteral
public int getNumberOfPagesLiteral()Returns the number of pages of the resulting PDF. Contrary to
getNumberOfPages()
, this method takes merge operations into account and returns the literal number of pages of the resulting PDF. -
getLog
Returns the
Log
of the conversion. The log only has content if an appropriateConfiguration.LogLevel
was set. -
getExceedingContents
Provides information about content exceeding its page or parent. Depends on the mode set via
Configuration.setContentObserver(Configuration.ContentObserver)
.- Returns:
- An array of
ExceedingContent
objects ornull
if the logging of exceeding content was not enabled or no content exceeded its page or parent.
-
getMissingResources
Provides information about resources that could not be loaded during the conversion. Depends on the mode set via
Configuration.setContentObserver(Configuration.ContentObserver)
.- Returns:
- An array of
MissingResource
objects ornull
if the logging of missing resources was not enabled or no resources were missing.
-
getConnections
Provides a log about all URL connections attempted by PDFreactor, including information about HTTP request and result, should the connection be an HTTP or HTTPS connection. Depends on the mode set via
Configuration.setContentObserver(Configuration.ContentObserver)
.- Returns:
- An array of
Connection
objects ornull
if the logging of connections was not enabled or no connections were attempted.
-
getConversionName
Returns the name of the conversion if it was specified via
Configuration.setConversionName(String)
. -
getJavaScriptExports
Returns data that has been exported from document JavaScript via
ro.exports
if set,null
otherwise. If the JavaScript data is not a string, it will be converted to JSON. If the data can't be converted, a generic string representation is used ornull
if none is available.
-