java.lang.Object
org.sejda.impl.sambox.component.split.AbstractPdfSplitter<T>
Type Parameters:
T - the type of parameters the splitter needs to have all the information necessary to perform the split.
Direct Known Subclasses:
PageDestinationsLevelPdfSplitter, PagesPdfSplitter, SizePdfSplitter

public abstract class AbstractPdfSplitter<T extends MultiplePdfSourceMultipleOutputParameters> extends Object
Abstract component providing a skeletal implementation of the split execution.
Author:
Andrea Vacondio
  • Constructor Details

    • AbstractPdfSplitter

      public AbstractPdfSplitter(org.sejda.sambox.pdmodel.PDDocument document, T parameters, boolean optimize, boolean discardOutline)
  • Method Details

    • split

      public void split(TaskExecutionContext executionContext, String outputPrefix, PdfSource<?> source) throws TaskException
      Throws:
      TaskException
    • enrichNameGenerationRequest

      public abstract NameGenerationRequest enrichNameGenerationRequest(NameGenerationRequest request)
    • nextOutputStrategy

      public abstract NextOutputStrategy nextOutputStrategy()
      Returns:
      the strategy to use to know if it's time to open a new document or close the current one.
    • onOpen

      protected void onOpen(int page) throws TaskException
      Called when an output document is going to be opened. Extending classes can plug some logic here.
      Parameters:
      page - the page number which is going to be added
      Throws:
      TaskException
    • onRetain

      protected void onRetain(int page) throws TaskException
      Called when the given page is going to be added . Extending classes can plug some logic here.
      Parameters:
      page - the page number which is going to be added
      Throws:
      TaskException
    • onClose

      protected void onClose(int page) throws TaskException
      Called when an output document is going to be closed. Extending classes can plug some logic here.
      Parameters:
      page - the last added page number
      Throws:
      TaskException
    • supplyPagesExtractor

      protected PagesExtractor supplyPagesExtractor(org.sejda.sambox.pdmodel.PDDocument document)
      Creates the PagesExtractor to be used by this AbstractPdfSplitter