Skip to content

Conversation

@Chapoly1305
Copy link

This pull request introduces support for hierarchical splitting of PDF files by bookmarks, enabling the creation of directory structures based on bookmark levels. The main changes include the addition of a new task and parameters to handle hierarchical output, enhancements to the task execution controller to route hierarchical split requests, and updates to module dependencies.

Demo
In Settings.
Screenshot 2025-11-13 at 12 47 50 PM

Exported PDF Destination Folders.
image

Tested on macOS.

Hierarchical Split Functionality

  • Added HierarchicalSplitByBookmarksTask, which splits PDFs by bookmarks and creates directories for parent bookmarks, placing child splits within them. It supports overlap and auto-detection of overlapping pages for more accurate splits.
  • Introduced HierarchicalSplitByOutlineLevelParameters, an extension of SplitByOutlineLevelParameters, to configure hierarchical output, overlap pages, and auto-detect overlap options.
  • Updated SplitByOutlineLevelParametersBuilder to include options for hierarchical output, overlap pages, and auto-detect overlap.

Task Execution Routing

  • Modified TaskExecutionController to detect and route hierarchical split requests to the new task using reflection, avoiding direct dependencies and circular references. [1] [2]

Dependency and Module Configuration

  • Added necessary dependencies (sejda-core, sejda-commons, sejda-sambox) to pdfsam-split-by-bookmarks and updated the module descriptor to require these modules, ensuring the new functionality can access required PDF processing features. [1] [2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant