Class SplitTool


  • public class SplitTool
    extends Object
    Allows the splitting of a PDF in segments using different policies from inside the Automation
    Since:
    8.4
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • SplitTool

        public SplitTool()
    • Method Detail

      • splitAllPages

        public List<com.logicaldoc.core.document.Document> splitAllPages​(long docId,
                                                                         String user)
                                                                  throws Exception
        Splits a PDF, every page in a separated file
        Parameters:
        docId - identifier of the document
        user - the current user
        Returns:
        list of segments
        Throws:
        Exception - error during the splitting
      • splitSelection

        public List<com.logicaldoc.core.document.Document> splitSelection​(long docId,
                                                                          String expression,
                                                                          String user)
                                                                   throws Exception
        Splits a PDF, into a selection of pages
        Parameters:
        docId - identifier of the document
        expression - the selection of pages (e.g.: 1,2,4-6,9)
        user - the current user
        Returns:
        list of segments
        Throws:
        Exception - error during the splitting
      • splitUsingBarcode

        public List<com.logicaldoc.core.document.Document> splitUsingBarcode​(long docId,
                                                                             String expression,
                                                                             int separator,
                                                                             String user)
                                                                      throws Exception
        Splits a PDF using a barcode as separator
        Parameters:
        docId - identifier of the document
        expression - regular expression that must be matched by the barcode's value, see Pattern
        separator - how to handle the separator: 0 = skip, 1 = append to current segment, 2 = prepend to next segment
        user - the current user
        Returns:
        list of segments
        Throws:
        Exception - error during the splitting
      • splitUsingText

        public List<com.logicaldoc.core.document.Document> splitUsingText​(long docId,
                                                                          String expression,
                                                                          int separator,
                                                                          String user)
                                                                   throws Exception
        Splits a PDF using a text as separator
        Parameters:
        docId - identifier of the document
        expression - regular expression that must be matched by the text, see Pattern
        separator - how to handle the separator: 0 = skip, 1 = append to current segment, 2 = prepend to next segment
        user - the current user
        Returns:
        list of segments
        Throws:
        Exception - error during the splitting
      • splitUsingBlankPage

        public List<com.logicaldoc.core.document.Document> splitUsingBlankPage​(long docId,
                                                                               int separator,
                                                                               String user)
                                                                        throws Exception
        Splits a PDF using a blank page as separator
        Parameters:
        docId - identifier of the document
        separator - how to handle the separator: 0 = skip, 1 = append to current segment, 2 = prepend to next segment
        user - the current user
        Returns:
        list of segments
        Throws:
        Exception - error during the splitting