• 3 replies
  • Latest Post - ‏2015-03-10T17:09:36Z by Shannan
3 Posts

Pinned topic Split a multi page tiff document in IBM CM into multiple documents

‏2010-06-16T17:29:08Z |
Hi everone,

I hope you can help me help a customer of mine with this request:

Our Content Manager users are requesting to have the ability to split a multi page tiff document in CM into multiple documents. For example to be able to split a single 5-page tiff document into a 3-page tiff and a 2-page tiff. Could you please check with your CM technical resources to see whether this functionality exists in CM or whether there are any APIs which would enable us to split a multi page tiff document into multiple documents. Your help is greatly appreciated.

I checked with Don Benson and he suggested that the CM Beans can be used to manipulate a document.

Your thoughts and ideas are welcome!!

  • SystemAdmin
    228 Posts

    Re: Split a multi page tiff document in IBM CM into multiple documents

    You're very close already. Your second link below was to the CMBDocumentServices class. That class has a method called copyPages(). It takes two CMBDocument objects, and page numbers as arguments. The idea is to copy pages N-M from a source CMBDocument object, and insert those pages into a destination CMBDocument object. If what you're looking for is a way to copy pages using a custom Java application, that would be a good method to start with.

    File srcFile = 
    new File(
    "c:\\temp\\5page.tif"); File dest1File = 
    new File(
    "c:\\temp\\3page.tif"); File dest2File = 
    new File(
    // initialize the engines. Properties engineProperties = 
    new Properties(); engineProperties.put(
    "1"); engineProperties.put(
    ""); engineProperties.put(
    "UNCOMPRESSED"); engineProperties.put(
    "UNCOMPRESSED"); engineProperties.put(
    // initialize streaming doc services CMBStreamingDocServices docServices = 
    new CMBStreamingDocServices(null, engineProperties); docServices.setPreferredFormats(
    new String[] 
    // Load 5page.tif String mimetype = 
    "image/tiff"; FileInputStream inStream = 
    new FileInputStream(srcFile); CMBDocument srcDoc = docServices.loadDocument(inStream, 1, mimetype, mimetype, null, 
    // Create a CMBDocument to hold 3page.tif CMBDocument destDoc = docServices.createDocument(mimetype); 
    // copy pages 1 - 3 docServices.copyPages(srcDoc,1,3,destDoc,0); 
    // write to disk destDoc.write(
    new FileOutputStream(dest1File)); 
    // clean up docServices.dropDocument(destDoc);   
    // Rinse and repeat for 2page.tif destDoc = docServices.createDocument(mimetype); docServices.copyPages(srcDoc,4,5,destDoc,0); destDoc.write(
    new FileOutputStream(dest2File)); docServices.dropDocument(destDoc);   
    // clean up the source document docServices.dropDocument(srcDoc); docServices.terminate(); 
    catch (Throwable e) 
    { e.printStackTrace(); 

    Obviously, this code doesn't retrieve from the resource manager and doesn't store the new documents back. There are samples in the Information Integrator for Content distribution that describe how to interact with the resource manager. I'll let you combine the two together.
  • kuto
    1 Post

    Re: Split a multi page tiff document in IBM CM into multiple documents


     i am not clear whrther abode has such a  tool, but i usually do such a work and i am using some good imaging sdks which can do the job. iam not an export in the realm, but i have several years´ experience so i can give you some advices. there are many ways to do that. If you wanna save these complicated steps and find a easy way, you can google split tiff and you will find many useful tools, or google how to split tiff to get instructive articles. I use a tiff spliter driver found on the internet . Install it and it becomes a selectable option.Then you can split mutipage tiff into single ones in many formats in any program at all, including Adobe Acrobat . Just open the sdk, select tiff, and choice split, then you can split tiff in vb, c#, asp ,etc ,the task will be finished in several seconds. if you haven´t found a good choice , you can have a try. best wishes.

  • Shannan
    4 Posts

    Re: Split a multi page tiff document in IBM CM into multiple documents


    We currently split our tiff objects with the eclient - (create new doc, copy or cut pages from current doc, paste into the new one and do the save back to CM.  We are looking for a replacement for this to use with the Navigator.  Have asked a few IBM support people and they acknowledge that the Navigator doesn't have this built in.  We're still looking for options on this.  We split tiff objects alot (agents send in faxes for multiple insureds at a time, or documents need to be broken up as part of the document needs to be reprinted and mailed out, but not all of it, etc...  )  Let me know if anyone is doing this with the navigator and which tiff editor you have found to work well.