Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Split PDFs by Chapters/Bookmarks #1786

Merged
merged 9 commits into from
Sep 4, 2024

Conversation

Rudra-241
Copy link
Contributor

Description

Feature to split PDFs by bookmarks, this feature only works for PDF files that contain outlines. Command to test it using curl:


curl --location 'http://{API_URL}/api/v1/general/split-pdf-by-chapters' \
--form 'fileInput=@"path/to/file.pdf"' \
--form 'includeMetadata="true"' \
--form 'bookmarkLevel="0"' \
--form 'allowDuplicates="true"' \
--output path/to/response.zip

Fields

  • bookmarkLevel: specifies the maximum level of bookmarks required. 0 means top level bookmarks.
  • includeMetadata: specifies whether to include the original file's metadata in all the split files.
  • allowDuplicates: Controls the behavior when multiple bookmarks correspond to the same page. If true, duplicates are generated; if false, bookmarks corresponding to the same page are merged into a single entry.

Partially addresses #(1592)
The requester wants this feature to apply to all PDFs, including those that do not have outlines.

Checklist:

  • I have read the Contribution Guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@github-actions github-actions bot added Java Pull requests that update Java code API API-related issues or pull requests labels Aug 31, 2024
@Frooodle
Copy link
Member

Looks good to me!

@Rudra-241 Rudra-241 marked this pull request as ready for review September 1, 2024 08:22
@Rudra-241 Rudra-241 requested a review from Frooodle as a code owner September 1, 2024 08:22
@Frooodle Frooodle merged commit 03887cc into Stirling-Tools:main Sep 4, 2024
2 checks passed
dingyang666 pushed a commit to njtech-latex/Stirling-PDF that referenced this pull request Sep 18, 2024
* feature:split pdf by chapters

* Update SplitPdfByChaptersController.java

* Update SplitPdfByChaptersController.java

* Update SplitPdfByChaptersController.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API-related issues or pull requests Java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants