Class PDFPageSplitter

  • All Implemented Interfaces:
    IXMLConfigurable, IImporterHandler, IDocumentSplitter

    public class PDFPageSplitter
    extends AbstractDocumentSplitter
    implements IXMLConfigurable

    Split PDFs pages so each pages are treated as individual documents. May not work on all PDFs (e.g., encrypted PDFs).

    The original PDF is kept intact. If you want to eliminate it to keep only the split pages, make sure to filter it. You can do so by filtering out PDFs without one of these two fields added to each pages: document.pdf.pageNumber or document.pdf.numberOfPages. A filtering example:

    XML usage example:

    
    <filter
        class="com.norconex.importer.handler.filter.impl.EmptyFilter"
        onMatch="exclude">
      <fieldMatcher
          matchWhole="true">
        document.pdf.pageNumber
      </fieldMatcher>
    </filter>

    By default this splitter restricts its use to document.contentType matching application/pdf.

    Should be used as a pre-parse handler.

    XML configuration usage:

    
    <handler
        class="com.norconex.importer.handler.splitter.impl.PDFPageSplitter">
      <!-- multiple "restrictTo" tags allowed (only one needs to match) -->
      <restrictTo>
        <fieldMatcher>(field-matching expression)</fieldMatcher>
        <valueMatcher>(value-matching expression)</valueMatcher>
      </restrictTo>
      <referencePagePrefix>
        (String to put before the page number is appended to the document
        reference. Default is "#".)
      </referencePagePrefix>
    </handler>

    XML usage example:

    
    <handler
        class="PDFPageSplitter">
      <referencePagePrefix>#page</referencePagePrefix>
    </handler>

    The above example will split PDFs and will append the page number to the original PDF reference as "#page1", "#page2", etc.

    Since:
    2.9.0
    Author:
    Pascal Essiembre