Class Result

java.lang.Object
com.realobjects.pdfreactor.Result

public class Result extends Object

The Result class represents the result of a PDFreactor conversion.

  • 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 the PDFreactor.convert(Configuration, OutputStream) method, this returns null.

    • getDocumentArray

      public byte[][] getDocumentArray()

      Returns the converted multi-page image, only if Configuration.OutputFormat.setMultiImage(Boolean) was set to true and Configuration.setOutputFormat(com.realobjects.pdfreactor.Configuration.OutputFormat) was set to an image format, otherwise it returns null.

    • 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

      public Log getLog()

      Returns the Log of the conversion. The log only has content if an appropriate Configuration.LogLevel was set.

    • getExceedingContents

      public ExceedingContent[] 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 or null if the logging of exceeding content was not enabled or no content exceeded its page or parent.
    • getMissingResources

      public MissingResource[] 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 or null if the logging of missing resources was not enabled or no resources were missing.
    • getConnections

      public Connection[] 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 or null if the logging of connections was not enabled or no connections were attempted.
    • getConversionName

      public String getConversionName()

      Returns the name of the conversion if it was specified via Configuration.setConversionName(String).

    • getJavaScriptExports

      public 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 or null if none is available.