@Override public void execute(ExtractByOutlineParameters parameters) throws TaskException { for(PdfSource<?> source: parameters.getSourceList()) { LOG.debug("Opening {} ", source); document = source.open(documentLoader).getUnderlyingPDDocument(); LOG.debug("Retrieving outline information for level {} and match regex {}", parameters.getLevel(), parameters.getMatchingTitleRegEx()); OutlineExtractPageDestinations pagesDestination = new SamboxOutlineLevelsHandler(document, parameters.getMatchingTitleRegEx()).getExtractPageDestinations(parameters.getLevel(), parameters.isIncludePageAfter()); LOG.debug("Starting extraction by outline, level {} and match regex {}", parameters.getLevel(), parameters.getMatchingTitleRegEx()); new PageDestinationsLevelPdfExtractor(document, parameters, pagesDestination, source) .extract(executionContext()); nullSafeCloseQuietly(document); } LOG.debug("Extraction completed and outputs written to {}", parameters.getOutput()); }
@Override public void execute(ExtractByOutlineParameters parameters) throws TaskException { for(PdfSource<?> source: parameters.getSourceList()) { LOG.debug("Opening {} ", source); document = source.open(documentLoader).getUnderlyingPDDocument(); LOG.debug("Retrieving outline information for level {} and match regex {}", parameters.getLevel(), parameters.getMatchingTitleRegEx()); OutlineExtractPageDestinations pagesDestination = new SamboxOutlineLevelsHandler(document, parameters.getMatchingTitleRegEx()).getExtractPageDestinations(parameters.getLevel(), parameters.isIncludePageAfter()); LOG.debug("Starting extraction by outline, level {} and match regex {}", parameters.getLevel(), parameters.getMatchingTitleRegEx()); new PageDestinationsLevelPdfExtractor(document, parameters, pagesDestination, source) .extract(executionContext()); nullSafeCloseQuietly(document); } LOG.debug("Extraction completed and outputs written to {}", parameters.getOutput()); }