Package jp.cssj.cti2

Interface CTISession

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
AbstractCTISession, V1Session, V2Session

public interface CTISession extends Closeable
A connection to a server for converting documents.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte
    A constant for forcibly aborting processing.
    static final byte
    A constant for aborting at a suitable stopping point.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    abort(byte mode)
    Aborts conversion.
    void
    Closes the session.
    Returns server information.
    void
    With setContinues(true) set, combines and outputs the results of multiple transcode calls.
    void
    property(String name, String value)
    Sets a property.
    void
    Clears all sent resources and all settings, including properties and the message handler, and restores the initial state the session had when it was created.
    void
    resource(net.zamasoft.zstream.resolver.Source source)
    Sends a resource.
    resource(net.zamasoft.zstream.resolver.SourceMetadata metaSource)
    Returns an output stream for sending a resource.
    void
    setContinuous(boolean continuous)
    Switches to a mode that combines multiple results.
    void
    Sets the object that receives messages.
    void
    Sets the object that monitors progress.
    void
    Sets the output destination.
    void
    setSourceResolver(net.zamasoft.zstream.resolver.SourceResolver resolver)
    Sets the object that loads resources.
    void
    Retrieves and converts the main document by accessing the specified address from the server.
    void
    transcode(net.zamasoft.zstream.resolver.Source source)
    Retrieves the main document from a data source and converts it.
    transcode(net.zamasoft.zstream.resolver.SourceMetadata metaSource)
    Returns an output stream for sending the main document.
  • Field Details

    • ABORT_NORMAL

      static final byte ABORT_NORMAL
      A constant for aborting at a suitable stopping point. Pass this to the abort method.
      See Also:
    • ABORT_FORCE

      static final byte ABORT_FORCE
      A constant for forcibly aborting processing. Pass this to the abort method.
      See Also:
  • Method Details

    • getServerInfo

      InputStream getServerInfo(URI uri) throws IOException
      Returns server information. For details, see the Copper PDF documentation.
      Parameters:
      uri - The URI that selects the server information.
      Returns:
      A stream of server information data.
      Throws:
      IOException
    • setResults

      void setResults(Results results) throws IOException

      Sets the output destination.

      You must call this method before any transcode method.

      Parameters:
      results - The output destination.
      Throws:
      IOException
    • setMessageHandler

      void setMessageHandler(MessageHandler messageHandler) throws IOException

      Sets the object that receives messages.

      You must call this method before any transcode method.

      Parameters:
      messageHandler - The message handler
      Throws:
      IOException
      See Also:
    • setProgressListener

      void setProgressListener(ProgressListener progressListener) throws IOException

      Sets the object that monitors progress.

      You must call this method before any transcode method.

      Parameters:
      progressListener - The progress listener
      Throws:
      IOException
      See Also:
    • property

      void property(String name, String value) throws IOException

      Sets a property.

      You must call this method before any transcode method.

      Parameters:
      name - The property name
      value - The value
      Throws:
      IOException
    • resource

      OutputStream resource(net.zamasoft.zstream.resolver.SourceMetadata metaSource) throws IOException

      Returns an output stream for sending a resource.

      Always close the output stream after sending the resource.

      You must call this method before any transcode method.

      Parameters:
      SourceMetadata - Metadata for the resource data.
      Returns:
      An output stream to the server.
      Throws:
      IOException
    • resource

      void resource(net.zamasoft.zstream.resolver.Source source) throws IOException

      Sends a resource.

      You must call this method before any transcode method.

      Parameters:
      source - The data source for the resource.
      Throws:
      IOException
    • setSourceResolver

      void setSourceResolver(net.zamasoft.zstream.resolver.SourceResolver resolver) throws IOException

      Sets the object that loads resources.

      Parameters:
      resolver - The SourceResolver that retrieves resources requested by the server.
      Throws:
      IOException
    • transcode

      OutputStream transcode(net.zamasoft.zstream.resolver.SourceMetadata metaSource) throws IOException

      Returns an output stream for sending the main document.

      Always close the output stream after sending the document body.

      Parameters:
      SourceMetadata - Metadata for the main document.
      Returns:
      An output stream to the server.
      Throws:
      IOException
    • transcode

      void transcode(URI uri) throws IOException, TranscoderException

      Retrieves and converts the main document by accessing the specified address from the server. This also works with resources you previously sent using the resource method.

      Parameters:
      uri - The URI of the main document.
      Throws:
      IOException
      TranscoderException
    • transcode

      void transcode(net.zamasoft.zstream.resolver.Source source) throws IOException, TranscoderException

      Retrieves the main document from a data source and converts it.

      Parameters:
      source - The data source for the main document.
      Throws:
      IOException
      TranscoderException
    • setContinuous

      void setContinuous(boolean continuous) throws IOException

      Switches to a mode that combines multiple results.

      Parameters:
      continuous - If true, enables the mode that combines results using join.
      Throws:
      IOException
    • join

      void join() throws IOException

      With setContinues(true) set, combines and outputs the results of multiple transcode calls.

      Throws:
      IOException
    • abort

      void abort(byte mode) throws IOException

      Aborts conversion. You must call this method asynchronously (from another thread). When processing actually stops, the thread performing the conversion (the one that called transcode) throws a TranscoderException.

      Parameters:
      mode - Specify ABORT_NORMAL to output up to a suitable stopping point, or ABORT_FORCE to forcibly stop processing.
      Throws:
      IOException
    • reset

      void reset() throws IOException

      Clears all sent resources and all settings, including properties and the message handler, and restores the initial state the session had when it was created.

      Throws:
      IOException
    • close

      void close() throws IOException

      Closes the session.

      You cannot perform any operations on the session after calling this method.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException