com.ibm.mm.viewer

Class CMBStreamingDocServices

  1. java.lang.Object
  2. extended bycom.ibm.mm.viewer.CMBStreamingDocServices
All implemented interfaces:
CMBViewerConstants, java.io.Serializable

  1. public class CMBStreamingDocServices
  2. extends java.lang.Object
  3. implements CMBViewerConstants, java.io.Serializable
CMBStreamingDocServices provides services to render, convert, reconstitute, and manipulate the pages of one or more documents: This is a non-visual class and provides no user interface elements. Another class, CMBGenericDocViewer, provides a Swing-based viewer user interface (using the services of CMBStreamingDocServices) suitable for use in Java applications and applets.

CMBStreamingDocServices is very similar to the CMBDocumentServices bean (and is, in fact, used by CMBDocumentServices). However, it's methods use on streams rather than references CMBItem objects or other non-visual beans. This allows this class (and other classes in com.ibm.mm.viewer and com.ibm.mm.viewer.annotation packages) to be used without need for a direct connection to a content server.

Supported Document Types and Conversions

The following tables summarize the document types and conversions supported by default (using the supplied conversion engines). Additional conversion capabilities can be plugged in using by creating classes that extend CMBDocumentEngine and adding those to the list of engines in the engine properties passed on the constructor of CMBStreamingDocServices.

On Windows:

MIME Type Engine Paginated With Annotations Page Manipulation Supported Converted To
application/afp CMBODDocumentEngine Yes1 No No text/html
application/afp CMBODDocumentEngine No No No application/afp2
application/lin
application/ondemand line
CMBODDocumentEngine No No No text/plain3
image/tiff
image/tif
image/gif
image/jpeg
image/bmp
text/plain
application/vnd.ibm.modcap
CMBMSTechDocumentEngine Yes Yes Yes image/gif
image/jpeg
image/tiff
application/vnd.ibm.modcap
text/plain5
image/pcx
image/dcx
CMBMSTechDocumentEngine Yes Yes No image/gif
image/jpeg
text/enriched
text/richtext
text/rtf
text/html
application/vnd.lotus-1-2-3
application/vnd.ms-excel
application/wordperfect5.1
application/msword
application/vnd.lotus-wordpro
CMBMSTechInsoEngine Yes Yes No image/gif
image/jpeg
text/url CMBJavaDocumentEngine No No No text/html4

On AIX and Solaris:

MIME Type Engine Paginated With Annotations Page Manipulation Supported Converted To
application/afp CMBODDocumentEngine No No No application/afp2
image/tiff
image/tif
image/gif
image/jpeg
image/bmp
text/plain
application/vnd.ibm.modcap
CMBMSTechDocumentEngine Yes Yes Yes image/gif
image/jpeg
image/tiff
application/vnd.ibm.modcap
text/plain5
image/pcx
image/dcx
CMBMSTechDocumentEngine Yes Yes No image/gif
image/jpeg
text/url CMBJavaDocumentEngine No No No text/html4

On Linux:

MIME Type Engine Paginated With Annotations Page Manipulation Supported Converted To
application/afp CMBODDocumentEngine No No No application/afp2
image/tiff
image/tif
image/gif
image/jpeg
image/bmp
text/plain
application/vnd.ibm.modcap
CMBMSTechDocumentEngine Yes Yes Yes image/gif
image/jpeg
image/tiff
application/vnd.ibm.modcap
text/plain5
image/pcx
image/dcx
CMBMSTechDocumentEngine Yes Yes No image/gif
image/jpeg
text/url CMBJavaDocumentEngine No No No text/html4

Notes:

  1. The AFP2Web toolkit is used to perform paginated conversion to text/hml. This toolkit is not packaged with DB2 Information Integrator for Content. It is available separately. Also, the bridge to AFP2Web contained within CMBODDocumentEngine is Windows only, so AFP to HTML conversion is only available on Windows using this engine.
  2. AFP to AFP conversion also concatenates segments of large object documents.
  3. Line data to plain text conversion also converts EBCDIC to ASCII.
  4. text/url is a special MIME type used to indicate that a plain text document contains a URL. CMBStreamingDocServices will convert the URL into a HTML document with an auto-forwarding link.
  5. A document of any source type can be written to any of these target types only if it is possible for the target type. A multi-page document cannot be written to the image/jpeg and image/bmp types. An image document cannot be written to the plain/text type.

Specifying Conversion Preferences

There are three properties on CMBStreamingDocServices that are used together to determine the type of conversion that will occur for each document type:

The default for these properties have pagination and conversion to single pages for all document types if possible. Also, the preferred formats are those supported by most browsers.

Engine Properties

Individual document conversion engines may have special properties. These can be specified using the EngineProperties property. See the reference for each of the document engine classes for details on the specific properties supported by each engine.

The default value for EngineProperties:

When modifying engine properties, you'll need to perform getEngineProperties to get the default properties, then add values to the Properties object returned, and use setEngineProperties to update the properties. Otherwise, your settings will override the defaults.

Engine properties must be updated before using any other methods in CMBDocumentServices for the properties to take effect.

Warning: The default configurations of engines may change from release to release. Therefore, if you modify engine properties, be sure to do so in a way that will not cause problems when the default set of engines is modified. This means, if you add an engine, you should decide to place the engine before or after the default engines and adjust the engine properties so that all of the default engines will still appear in the engine properties, in their current order.

The default engine properties are set by a file included part of the cmbview81.jar
called "cmbviewerengine.properties", and are loaded from the classpath. You can therefore also copy this file, modify it to suit your application, and place it in front of cmbview81.jar in the classpath.

The DELAYINIT engine property :
You can choose to delay the initialization of any specific engine by setting ENGINE<n>_DELAYINIT=true. This delays the initialization until the engine is used for document conversion. By default, initialization is not delayed and is done during the first loadDocument() method.

Engine properties specific to the com.ibm.mm.viewer.mstech.CMBMSTechDocumentEngine are:

PLAIN_TEXT_PAGE_WIDTH
The page width that will be used while creating a page image of a plain text file. The default value used is 800 , that gives 80 characters per line.
PLAIN_TEXT_PAGE_HEIGHT
The page height that will be used while creating a page image of a plain text file. The default value used is 1100.
MAX_GDI_BMP_WIDTH
The maximum width in pixels of the memory GDI bitmap that will be used for converting a page. The default value here is 2400.
MAX_GDI_BMP_HEIGHT
The maximum height in pixels of the memory GDI bitmap that will be used for converting a page. The default value here is 2400.
IWPM_STOPAT_EDT
This options is for IWPM compatibility. Modca format allows and hence the MSTech engine parses a document containing more than one set of BDT-EDT pairs showing all pages from those multiple sets. But IWPM viewer stops at the first EDT tag. Allowed values are true and false. false is the default value.
TIFF_1BIT_COMPRESSION
The compression for changed pages when document is saved for 1 bit TIFF. The default is G3_COMPRESSION and the allowed values are:
  • G3_COMPRESSION
  • G4_COMPRESSION
  • HUFFMAN_COMPRESSION
  • PACKEDBITS
  • UNCOMPRESSED
TIFF_4BIT_COMPRESSION
The compression for changed pages when document is saved for 4 bit TIFF. The default is PACKEDBITS and the allowed values are:
  • PACKEDBITS
  • UNCOMPRESSED
TIFF_8BIT_COMPRESSION
The compression for changed pages when document is saved for 8 bit TIFF. The default is PACKEDBITS and the allowed values are:
  • PACKEDBITS
  • UNCOMPRESSED
TIFF_24BIT_COMPRESSION
With a 24 bit TIFF, JPEG_COMPRESSION will be used for the compression for changed pages when the document is saved. The only value available for this is option is JPEG_COMPRESSION.
Since:
7.1
See Also:
CMBDocumentServices, Serialized Form

Field Summary

Fields inherited from interface com.ibm.mm.viewer.CMBViewerConstants
ACTION_NAME_UNKNOWN, ANNO_EDIT_MODE, CHANGETYPE_ADD_ANN, CHANGETYPE_BALANCE, CHANGETYPE_BOOKMARKS, CHANGETYPE_DEL_ANN, CHANGETYPE_DOCUMENT_OCR, CHANGETYPE_DOCUMENT_TEXT, CHANGETYPE_ENHANCE, CHANGETYPE_HIT_HIGHLIGHT, CHANGETYPE_INVERT, CHANGETYPE_MOD_ANN, CHANGETYPE_MODE_ANN, CHANGETYPE_MODE_AREA, CHANGETYPE_OCR_CANCEL, CHANGETYPE_PAGE, CHANGETYPE_PAGE_OCR, CHANGETYPE_PAGE_TEXT, CHANGETYPE_PAGECNT, CHANGETYPE_PAGES_ADDED, CHANGETYPE_PAGES_COPIED, CHANGETYPE_PAGES_DELETED, CHANGETYPE_PAGES_MODIFIED, CHANGETYPE_PAGES_MOVED, CHANGETYPE_PAGES_SELECTED, CHANGETYPE_ROTATE, CHANGETYPE_SCALE, CHANGETYPE_TEXT_SELECTED, CHANGETYPE_UNKNOWN, CHANGETYPE_VIEWABLE_PAGES_CHANGED, CMBGENERICDOCVIEWER_NAME, DEFAULT_DISPLAY_RESOLUTION, DEFAULT_PAGE_NUMBER, DEFAULT_ZOOM_FACTOR, EXPORT_DIALOG_NAME, FIT_ACTUAL_SIZE, FIT_HEIGHT, FIT_IN_WINDOW, FIT_NONE, FIT_WIDTH, FULL_PAGE_SCROLL_INCREMENT, LAYOUT_SINGLE, LAYOUT_SPLIT_HORIZONTAL, LAYOUT_SPLIT_VERTICAL, LAYOUT_TABBED, LAYOUT_THUMBNAILS_ONLY, MIMETYPE_DOC, MIMETYPE_DOCX, MIMETYPE_HTML, MIMETYPE_ODP, MIMETYPE_ODS, MIMETYPE_ODT, MIMETYPE_PDF, MIMETYPE_PNG, MIMETYPE_PPT, MIMETYPE_PPTX, MIMETYPE_TXT, MIMETYPE_XLS, MIMETYPE_XLSX, NEW_DOC_DEFAULT_PAGE_NUMBER, OCR_CONFIDENCE_HIGH, OCR_CONFIDENCE_LOW, OCR_CONFIDENCE_UNDETERMINED, OCRSTATUSTYPE_CANCEL, OCRSTATUSTYPE_DOC, OCRSTATUSTYPE_PAGE, PREFERENCES_DIALOG_NAME, PRINT_DOCUMENT_DIALOG_NAME, PRINT_DOCUMENTS_DIALOG_NAME, PRINTSTATUSTYPE_ADD, PRINTSTATUSTYPE_PAGE, PRINTSTATUSTYPE_REMOVE, PRINTSTATUSTYPE_REQUEST, PRINTSTATUSTYPE_UNKNOWN, PRIVILEGE_ADD_PAGES, PRIVILEGE_CREATE_DOCUMENT, PRIVILEGE_DELETE_PAGES, PRIVILEGE_EXPORT, PRIVILEGE_MODIFY_BOOKMARKS, PRIVILEGE_MOVE_PAGES, PRIVILEGE_PRINT, PRIVILEGE_REDACT_PAGE, PRIVILEGE_ROTATE_PAGE, ROTATE_0, ROTATE_180, ROTATE_270, ROTATE_90, SELECT_AREA_MODE, SELECT_TEXT_MODE, SIZE_LARGE, SIZE_MEDIUM, SIZE_SMALL, STYLE_BOLD, STYLE_BOLD_ITALIC, STYLE_ITALIC, STYLE_PLAIN

Constructor Summary

Constructor and Description
CMBStreamingDocServices()
CMBStreamingDocServices(CMBStreamingDocServicesCallbacks callbacks,java.util.Properties engineProperties)
Constructs CMBStreamingDocServices.

Method Summary

Modifier and Type Method and Description
  1. void
cancelOCR(CMBDocument document)
Using the OCR engine, cancel OCR of the document.
  1. boolean
canOcr(CMBDocument document)
Check if there is an OCR engine that will support OCR action on the specified document.
  1. void
copyPages(CMBDocument sourceDocument,int firstSourcePage,int lastSourcePage,CMBDocument destDocument,int destPage)
Copies a range of pages from one document to another document.
  1. CMBDocument
createDocument(java.lang.String mimeType)
Creates a new document initially with no content.
  1. void
dropAllDocuments()
Terminates processing of all documents.
  1. void
dropDocument(CMBDocument document)
Terminates processing of a document.
  1. void
dropOcrPage(CMBPage ocrPage,CMBGenericDocOCRStatusListener listener)
Release OCR page resources.
  1. java.util.Properties
getConversionProperties()
Returns the conversion properties.
  1. CMBDocument
getDocumentFromHandle(java.lang.Object hItem)
Determines the instance of CMBDocument from the associated item handle.
  1. int
getDocumentPageCount(CMBDocument doc)
Returns the number of pages in the document.
  1. CMBDocument[]
getDocuments()
Returns the documents being processed.
  1. CMBDocument
getDocuments(int index)
Returns a particular document being processed.
  1. java.lang.String
getEngineNameForMimeType(java.lang.String docMimeType)
Return the CMBDocumentEngine class name that should handle the given document mime type.
  1. java.lang.Object
getItemHandle(CMBDocument document)
Returns the handle related to a document.
  1. java.lang.String[]
getPreferredFormats()
Returns the preferred formats for converted documents.
  1. java.lang.String[]
getPreferredPageFormats()
Returns the preferred page formats for converted pages of documents.
  1. CMBDocument
loadDocument(java.io.InputStream firstPart,int firstPartSize,int numberOfParts,java.lang.String docMimeType,java.lang.String firstPartMimeType,java.io.InputStream annotations,java.io.InputStream resources)
Loads a document into document services.
  1. CMBDocument
loadDocument(java.io.InputStream firstPart,int firstPartSize,int numberOfParts,java.lang.String docMimeType,java.lang.String firstPartMimeType,java.io.InputStream annotations,java.io.InputStream resources,java.lang.String firstPartEncoding)
Loads a document into document services.
  1. CMBDocument
loadDocument(java.io.InputStream firstPart,int numberOfParts,java.lang.String docMimeType,java.lang.String firstPartMimeType,java.io.InputStream annotations,java.io.InputStream resources)
Loads a document into document services.
  1. CMBDocument
loadDocument(java.io.InputStream firstPart,int numberOfParts,java.lang.String docMimeType,java.lang.String firstPartMimeType,java.io.InputStream annotations,java.io.InputStream resources,java.lang.String firstPartEncoding)
Loads a document into document services.
  1. CMBDocument
loadDocument(java.net.URL firstPart,int firstPartSize,int numberOfParts,java.lang.String docMimeType,java.lang.String firstPartMimeType,java.io.InputStream annotations,java.io.InputStream resources,java.lang.String firstPartEncoding)
Loads a document into document services.
  1. void
movePages(CMBDocument sourceDocument,int firstSourcePage,int lastSourcePage,CMBDocument destDocument,int destPage)
Moves a range of pages from one document to another document.
  1. CMBOCRLetters[]
ocrDocument(CMBDocument document,CMBGenericDocOCRStatusListener listener)
Using the OCR Engine, perform OCR on each page of the currently selected document.
  1. CMBOCRLetters
ocrPage(CMBPage page,CMBGenericDocOCRStatusListener listener)
Using the OCR engine, perform OCR on the page number of the document.
  1. void
setConversionProperties(java.util.Properties properties)
Sets the conversion properties.
  1. void
setItemHandle(CMBDocument document,java.lang.Object itemHandle)
Sets a handle to a document.
  1. void
setPreferredFormats(java.lang.String[] formats)
Sets the preferred formats for converted documents, in the order of most preferred to least preferred.
  1. void
setPreferredPageFormats(java.lang.String[] pageFormats)
Sets the preferred page formats for converted pages of documents, in the order of most preferred to least preferred.
  1. void
terminate()
Terminates all the engines.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CMBStreamingDocServices

  1. public CMBStreamingDocServices( )

CMBStreamingDocServices

  1. public CMBStreamingDocServices( CMBStreamingDocServicesCallbacks callbacks,
  2. java.util.Properties engineProperties)
Constructs CMBStreamingDocServices.
Parameters:
callbacks - implementation of CMBStreamingDocServicesCallbacks with methods that are called to retrieve additional document parts.
engineProperties - properties object defining the engines classes and their properties. If this parameter is null, the default engine properties, as specified by the cmbviewerengine.properties file, will be used.

Method Detail

getDocuments

  1. public CMBDocument[] getDocuments( )
Returns the documents being processed.

getDocuments

  1. public CMBDocument getDocuments( int index)
  2. throws java.lang.ArrayIndexOutOfBoundsException
Returns a particular document being processed.
Throws:
java.lang.ArrayIndexOutOfBoundsException

getPreferredFormats

  1. public java.lang.String[] getPreferredFormats( )
Returns the preferred formats for converted documents. The default is text/html, application/pdf, text/plain.

setPreferredFormats

  1. public void setPreferredFormats( java.lang.String[] formats)
Sets the preferred formats for converted documents, in the order of most preferred to least preferred. When writing a document using CMBDocument.write, the format of the document will be one of the preferred formats if possible (i.e. supported by the document engine handling the document). If not, the document will be written in its original format.
Parameters:
formats - the MIME types for the preferred formats.

getPreferredPageFormats

  1. public java.lang.String[] getPreferredPageFormats( )
Returns the preferred page formats for converted pages of documents. The default is text/html, image/gif, image/jpeg.

setPreferredPageFormats

  1. public void setPreferredPageFormats( java.lang.String[] pageFormats)
Sets the preferred page formats for converted pages of documents, in the order of most preferred to least preferred. When writing a page using CMBPage.write, the format of the page will be one of the preferred page formats.

getConversionProperties

  1. public java.util.Properties getConversionProperties( )
Returns the conversion properties. This defines how document formats are converted.
See Also:
setConversionProperties

createDocument

  1. public CMBDocument createDocument( java.lang.String mimeType)
  2. throws CMBDocumentEngineException
Creates a new document initially with no content. Pages of other documents can by copied or moved to this document to form its content.

Note: The document created exists only in memory. The content can be obtained using CMBDocument.write() and written to a permanent content server.

Parameters:
mimeType - the MIME content type of the document being created
Returns:
an instance of CMBDocument representing the new document.
Throws:
CMBDocumentEngineException - if a document engine to handle documents of this type could not be initialized, or the engine cannot create documents of the specified mimeType. The former error is likely caused by a problem in the specification of the document engine properties. The latter is likely due to lack of support for page manipulation by the document engine.
Since:
8.3

setConversionProperties

  1. public void setConversionProperties( java.util.Properties properties)
Sets the conversion properties. This defines how documents are converted. Conversion occurs when the write() methods on CMBDocument and CMBPage are used. It has the following format:
<mimetype>=document|page|none
mimetype is the MIME content type for the documents. The value is defined:
document
Convert the entire document to one of the preferred formats. Separate document pages will not be available. If conversion to a preferred format is not possible, CMBDocument.write() will return the document unconverted.
page
Convert pages of the document to one of the preferred page formats. If the document can be parsed and individual pages can be converted, they will be made available (through CMBDocument.getPages()). If pages cannot be converted, document conversion will still be available. If even that is not possible, CMBDocument.write() will return the document unconverted.
none
Do not provide any conversion of the document type. No document pages are available, and CMBDocument.write() returns the document unconverted.
By default, all document types are converted to pages.

loadDocument

  1. public CMBDocument loadDocument( java.io.InputStream firstPart,
  2. int numberOfParts,
  3. java.lang.String docMimeType,
  4. java.lang.String firstPartMimeType,
  5. java.io.InputStream annotations,
  6. java.io.InputStream resources)
  7. throws java.io.IOException
  8. java.lang.ClassNotFoundException
  9. java.lang.IllegalAccessException
  10. java.lang.InstantiationException
Loads a document into document services.
Parameters:
firstPart - a stream containing the first part of the document.
numberOfParts - the number of parts of the document.
docMimeType - the MIME content type of the document.
firstPartMimeType - the MIME content type of the first part of the document.
annotations - a stream containing annotations for the document pages.
resources - a stream containing resources for the document.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

loadDocument

  1. public CMBDocument loadDocument( java.io.InputStream firstPart,
  2. int firstPartSize,
  3. int numberOfParts,
  4. java.lang.String docMimeType,
  5. java.lang.String firstPartMimeType,
  6. java.io.InputStream annotations,
  7. java.io.InputStream resources)
  8. throws java.io.IOException
  9. java.lang.ClassNotFoundException
  10. java.lang.IllegalAccessException
  11. java.lang.InstantiationException
Loads a document into document services. This version allows the part size of the first part to be specified.
Parameters:
firstPart - a stream containing the first part of the document.
firstPartSize - the size of the firstPart stream.
numberOfParts - the number of parts of the document
docMimeType - the MIME content type of the document
firstPartMimeType - the MIME content type of the first part of the document.
annotations - a stream containing annotations for the document pages.
resources - a stream containing resources for the document.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

loadDocument

  1. public CMBDocument loadDocument( java.io.InputStream firstPart,
  2. int numberOfParts,
  3. java.lang.String docMimeType,
  4. java.lang.String firstPartMimeType,
  5. java.io.InputStream annotations,
  6. java.io.InputStream resources,
  7. java.lang.String firstPartEncoding)
  8. throws java.io.IOException
  9. java.lang.ClassNotFoundException
  10. java.lang.IllegalAccessException
  11. java.lang.InstantiationException
Loads a document into document services. This version allows the character encoding of the first part to be specified. Character encoding would be used for plain text documents to determine the encoding of the characters in the document.
Parameters:
firstPart - a stream containing the first part of the document.
numberOfParts - the number of parts of the document
docMimeType - the MIME content type of the document
firstPartMimeType - the MIME content type of the first part of the document.
annotations - a stream containing annotations for the document pages.
resources - a stream containing resources for the document.
firstPartEncoding - the character encoding of the first part.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
Since:
8.3.0.2

loadDocument

  1. public CMBDocument loadDocument( java.io.InputStream firstPart,
  2. int firstPartSize,
  3. int numberOfParts,
  4. java.lang.String docMimeType,
  5. java.lang.String firstPartMimeType,
  6. java.io.InputStream annotations,
  7. java.io.InputStream resources,
  8. java.lang.String firstPartEncoding)
  9. throws java.io.IOException
  10. java.lang.ClassNotFoundException
  11. java.lang.IllegalAccessException
  12. java.lang.InstantiationException
Loads a document into document services. This version allows both the size of the first part and the character encoding of the first part to be specified. Character encoding would be used for plain text documents to determine the encoding of the characters in the document.
Parameters:
firstPart - a stream containing the first part of the document.
firstPartSize - the size of the firstPart stream.
numberOfParts - the number of parts of the document
docMimeType - the MIME content type of the document
firstPartMimeType - the MIME content type of the first part of the document.
annotations - a stream containing annotations for the document pages.
resources - a stream containing resources for the document.
firstPartEncoding - the character encoding of the first part.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
Since:
8.4

loadDocument

  1. public CMBDocument loadDocument( java.net.URL firstPart,
  2. int firstPartSize,
  3. int numberOfParts,
  4. java.lang.String docMimeType,
  5. java.lang.String firstPartMimeType,
  6. java.io.InputStream annotations,
  7. java.io.InputStream resources,
  8. java.lang.String firstPartEncoding)
  9. throws java.io.IOException
  10. java.lang.ClassNotFoundException
  11. java.lang.IllegalAccessException
  12. java.lang.InstantiationException
Loads a document into document services. This version takes a URL to the part content. The URL is assumed to be HTTP and allowing byte-range access.
Parameters:
firstPart - an HTTP URL to the first part of the document.
firstPartSize - the size of the firstPart stream.
numberOfParts - the number of parts of the document
docMimeType - the MIME content type of the document
firstPartMimeType - the MIME content type of the first part of the document.
annotations - a stream containing annotations for the document pages.
resources - a stream containing resources for the document.
firstPartEncoding - the character encoding of the first part.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
Since:
8.4.3

movePages

  1. public void movePages(CMBDocument sourceDocument,
  2. int firstSourcePage,
  3. int lastSourcePage,
  4. CMBDocument destDocument,
  5. int destPage)
  6. throws java.io.IOException
Moves a range of pages from one document to another document.
Parameters:
sourceDocument - the source document to move pages from
firstSourcePage - the page number of the first page to move
lastSourcePage - the page number of the last page to move. If this is the same value as firstSourcePage, one page is moved.
destDocument - the destination document to copy pages to. This can be the same document as sourceDocument
destPage - the page in the destDocument where the pages are to be moved after. If this number is zero, the pages are moved in front of all existing pages in destDocument.
Throws:
java.lang.IndexOutOfBoundsException - if the page numbers are invalid
java.lang.IllegalArgumentException - if the destPage is within the range of pages to move, or if the source and destination documents are not handled by the same document engine.
java.io.IOException - If an IO error occurs reading the document content
Since:
8.3

copyPages

  1. public void copyPages(CMBDocument sourceDocument,
  2. int firstSourcePage,
  3. int lastSourcePage,
  4. CMBDocument destDocument,
  5. int destPage)
  6. throws java.io.IOException
Copies a range of pages from one document to another document.
Parameters:
sourceDocument - the source document to copy pages from
firstSourcePage - the page number of the first page to copy
lastSourcePage - the page number of the last page to copy. If this is the same value as firstSourcePage, one page is copied.
destDocument - the destination document to copy pages to. This can be the same document as sourceDocument
destPage - the page where document pages are to be copied after. If this number is zero, the pages are copied in front of all existing pages in destDocument
Throws:
java.lang.IndexOutOfBoundsException - if the page numbers are invalid
java.lang.IllegalArgumentException - if the destPage is within the range of pages to copy, or if the source and destination documents are not handled by the same document engine.
java.io.IOException - If an IO error occurs reading the document content
Since:
8.3

getDocumentPageCount

  1. public int getDocumentPageCount( CMBDocument doc)
  2. throws java.io.IOException
  3. CMBDocumentEngineException
Returns the number of pages in the document.

Note: For large documents, calling this method may require that all parts of the document be retrieved from the server and processed, which could be time consuming.

Returns:
int The page count.
Throws:
java.io.IOException
CMBDocumentEngineException - when the CMBSnowboundEngine is unable to get the page count.
Since:
8.4.2.4

dropDocument

  1. public void dropDocument(CMBDocument document)
Terminates processing of a document.
Parameters:
document - the document being terminated.

dropAllDocuments

  1. public void dropAllDocuments()
Terminates processing of all documents.

setItemHandle

  1. public void setItemHandle(CMBDocument document,
  2. java.lang.Object itemHandle)
Sets a handle to a document. The handle can refer to any object. This is useful in callbacks to obtain an application object associated with the instance of CMBDocument.
Parameters:
document - the document whose handle is being set.
itemHandle - the value for the handle.

getItemHandle

  1. public java.lang.Object getItemHandle( CMBDocument document)
Returns the handle related to a document.
Parameters:
document - the document whose handle is being retrieved.

getDocumentFromHandle

  1. public CMBDocument getDocumentFromHandle( java.lang.Object hItem)
Determines the instance of CMBDocument from the associated item handle.
Parameters:
hItem - an object acting as a handle to the associated document. This object would have been associated with the document using setItemHandle(document).
Returns:
An instance of CMBDocument for the handle or null if no instance is associated with the handle.
See Also:
setItemHandle(document)

terminate

  1. public void terminate()
Terminates all the engines. Also drops all documents, so There is no need to call dropAllDocuments beforehand

getEngineNameForMimeType

  1. public java.lang.String getEngineNameForMimeType( java.lang.String docMimeType)
Return the CMBDocumentEngine class name that should handle the given document mime type.
Parameters:
docMimeType -
Returns:
CMBDocumentEngine class name

canOcr

  1. public boolean canOcr(CMBDocument document)
Check if there is an OCR engine that will support OCR action on the specified document.
Parameters:
document - The document requesting OCR support.
Returns:
true if the OCR engine may ocr the document

ocrPage

  1. public CMBOCRLetters ocrPage(CMBPage page,
  2. CMBGenericDocOCRStatusListener listener)
Using the OCR engine, perform OCR on the page number of the document. When OCR operation on the page has completed, text will be available for find and select.
Parameters:
page - The page that is requestion an OCR.
listener - for OCR engine OCR status events
Returns:
CMBOCRLetters object that contains array list of letters that represent the OCR of the page.
Throws:
CMBDocumentEngineException - when canOcrDocument returns false or there is no OCR engine.
Since:
8.4.3

dropOcrPage

  1. public void dropOcrPage(CMBPage ocrPage,
  2. CMBGenericDocOCRStatusListener listener)
Release OCR page resources.
Since:
8.4.3

ocrDocument

  1. public CMBOCRLetters[] ocrDocument( CMBDocument document,
  2. CMBGenericDocOCRStatusListener listener)
Using the OCR Engine, perform OCR on each page of the currently selected document. When OCR operation on the document has completed, text will be available for find and select.
Parameters:
document - The document that is requesting an OCR.
listener - for OCR engine OCR status events
Returns:
an array of CMBOCRLetters that represents the OCR of the document. Each CMBOCRLetters object represents one page.
Throws:
CMBDocumentEngineException - when canOcrDocument returns false or there is no OCR engine.
Since:
8.4.3

cancelOCR

  1. public void cancelOCR(CMBDocument document)
Using the OCR engine, cancel OCR of the document.
Parameters:
document - The document to cancel OCR process.
Throws:
CMBDocumentEngineException - when canOcrDocument returns false or there is no OCR engine.
Since:
8.4.3