Package com.saperion.util
Class MultipageDocUtil
java.lang.Object
com.saperion.util.MultipageDocUtil
Utility class for multipage documents.
 
E.g. to detect if a document contains pages of one multipage TIFF or scanpages ONLY. Filename conversions utility methods e.g. for zip files are also available.
- 
Method SummaryModifier and TypeMethodDescriptionstatic intautoGetElementNumber(List<SaDocInfo.ElementInfo> elements) Returns the element number to use to get the first element of a document.static StringconvertZipFilename(String path) Converts a multi-page filename in a zip filename.static StringgetFilename(String path) Extracts and returns the filename of the given path.static booleanisMultipageDoc(List<SaDocInfo.ElementInfo> elements) Returns true if the document contains the pages of a splitted multipage TIFF or scanned pages only.static booleanisMultipageTiff(String path) Checks if the given path contains a multi-page filename.static booleanisTiffDocument(SaDocInfo.ElementInfo element) Tries to guess if the document element has a multiple page tiff document Intended to work tiff documents stored in original format.
- 
Method Details- 
autoGetElementNumberReturns the element number to use to get the first element of a document. If the document is a splitted multipage TIFF or a scanned document, -1 will be returned in order to retrieve the entire document. Otherwise, the number of the first element is returned.- Parameters:
- elements- the document's structure elements
- Returns:
- -1 if multipage document, otherwise number of first element
 
- 
isMultipageDocReturns true if the document contains the pages of a splitted multipage TIFF or scanned pages only.- Parameters:
- elements- the document's structure elements
- Returns:
- true if multipage document, otherwise false
 
- 
isTiffDocumentTries to guess if the document element has a multiple page tiff document Intended to work tiff documents stored in original format.- Parameters:
- element-
- Returns:
 
- 
isMultipageTiffChecks if the given path contains a multi-page filename.A multi-page filename is specified by a "@" after the filename suffix. The number after the "@" describes the page number of the multi-page document. Example: file.tiff@1 - Parameters:
- path- the path containing a filename to check multi-page
- Returns:
- true, if path contains a multi-page filename
 
- 
getFilenameExtracts and returns the filename of the given path. Strips the possible '@' postfix. - Parameters:
- path- The path+filename to be extract the filename from. Should be a multi-page filename.
- Returns:
- The extracted filename.
 
- 
convertZipFilenameConverts a multi-page filename in a zip filename.Example: converts filename.tiff@3 to filename[3].tiff - Parameters:
- path- The path+filename to be extract the filename from. Should be a multi-page filename.
- Returns:
- the converted zip filename
 
 
-