Module org.sejda.impl.sambox
Class AbstractPdfSplitter<T extends MultiplePdfSourceMultipleOutputParameters>
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 Summary
ConstructorsConstructorDescriptionAbstractPdfSplitter(org.sejda.sambox.pdmodel.PDDocument document, T parameters, boolean optimize, boolean discardOutline) -
Method Summary
Modifier and TypeMethodDescriptionabstract NameGenerationRequestabstract NextOutputStrategyprotected voidonClose(int page) Called when an output document is going to be closed.protected voidonOpen(int page) Called when an output document is going to be opened.protected voidonRetain(int page) Called when the given page is going to be added .voidsplit(TaskExecutionContext executionContext, String outputPrefix, PdfSource<?> source) protected PagesExtractorsupplyPagesExtractor(org.sejda.sambox.pdmodel.PDDocument document) Creates thePagesExtractorto be used by thisAbstractPdfSplitter
-
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
-
nextOutputStrategy
- Returns:
- the strategy to use to know if it's time to open a new document or close the current one.
-
onOpen
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
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
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
Creates thePagesExtractorto be used by thisAbstractPdfSplitter
-