Interface CTISession
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AbstractCTISession,V1Session,V2Session
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteA constant for forcibly aborting processing.static final byteA constant for aborting at a suitable stopping point. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(byte mode) Aborts conversion.voidclose()Closes the session.getServerInfo(URI uri) Returns server information.voidjoin()With setContinues(true) set, combines and outputs the results of multiple transcode calls.voidSets a property.voidreset()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.voidresource(net.zamasoft.zstream.resolver.Source source) Sends a resource.resource(net.zamasoft.zstream.resolver.SourceMetadata metaSource) Returns an output stream for sending a resource.voidsetContinuous(boolean continuous) Switches to a mode that combines multiple results.voidsetMessageHandler(MessageHandler messageHandler) Sets the object that receives messages.voidsetProgressListener(ProgressListener progressListener) Sets the object that monitors progress.voidsetResults(Results results) Sets the output destination.voidsetSourceResolver(net.zamasoft.zstream.resolver.SourceResolver resolver) Sets the object that loads resources.voidRetrieves and converts the main document by accessing the specified address from the server.voidtranscode(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_NORMALA constant for aborting at a suitable stopping point. Pass this to the abort method.- See Also:
-
ABORT_FORCE
static final byte ABORT_FORCEA constant for forcibly aborting processing. Pass this to the abort method.- See Also:
-
-
Method Details
-
getServerInfo
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
Sets the output destination.
You must call this method before any transcode method.
- Parameters:
results- The output destination.- Throws:
IOException
-
setMessageHandler
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
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
Sets a property.
You must call this method before any transcode method.
- Parameters:
name- The property namevalue- The value- Throws:
IOException
-
resource
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
Sends a resource.
You must call this method before any transcode method.
- Parameters:
source- The data source for the resource.- Throws:
IOException
-
setSourceResolver
Sets the object that loads resources.
- Parameters:
resolver- The SourceResolver that retrieves resources requested by the server.- Throws:
IOException
-
transcode
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
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:
IOExceptionTranscoderException
-
transcode
Retrieves the main document from a data source and converts it.
- Parameters:
source- The data source for the main document.- Throws:
IOExceptionTranscoderException
-
setContinuous
Switches to a mode that combines multiple results.
- Parameters:
continuous- If true, enables the mode that combines results using join.- Throws:
IOException
-
join
With setContinues(true) set, combines and outputs the results of multiple transcode calls.
- Throws:
IOException
-
abort
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
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
Closes the session.
You cannot perform any operations on the session after calling this method.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-