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

[Fix] Handle missing end page in PDF split range #2816

Merged

Conversation

Abdurrahman-shaikh
Copy link
Contributor

@Abdurrahman-shaikh Abdurrahman-shaikh commented Jan 30, 2025

Summary of Changes

What was changed:

  • Updated the handlePart method to handle cases where the end page is not specified (e.g., '1-').
  • The method now defaults to the last page of the PDF, improving the feature's usability.

Why the change was made:

  • Users often forget the total page count when splitting PDFs. The new feature ensures that when only the starting page is specified, the range defaults to the last page, preventing errors like ArrayIndexOutOfBoundsException.

Any challenges encountered:

  • No significant challenges encountered while implementing this feature.

Closes #1576


Checklist

General

Testing

  • I have tested my changes locally.

Updated the  method to handle cases where the end page is not specified (e.g., '1-').
The method now defaults to the last page of the PDF, making the feature more intuitive and preventing ArrayIndexOutOfBoundsException.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 30, 2025
@github-actions github-actions bot added the Java Pull requests that update Java code label Jan 30, 2025
@Frooodle Frooodle enabled auto-merge (squash) January 30, 2025 18:13
@Frooodle Frooodle merged commit f59e024 into Stirling-Tools:main Jan 30, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Pull requests that update Java code size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Split PDF when total pages count is unknown
3 participants