Add option to skip corrupt PDFs in PDFMergerUtility with improved exception handling#208
Open
SwethaMuthuvel wants to merge 2 commits intoapache:trunkfrom
Open
Add option to skip corrupt PDFs in PDFMergerUtility with improved exception handling#208SwethaMuthuvel wants to merge 2 commits intoapache:trunkfrom
SwethaMuthuvel wants to merge 2 commits intoapache:trunkfrom
Conversation
added 2 commits
July 4, 2025 13:05
- Removed duplicate LOG.info calls from optimized and legacy merge methods. - Introduced shared field 'lastMergeSkippedCount' to track skipped corrupt PDFs. - Log merge summary once from mergeDocuments(), improving clarity and avoiding redundant output.
Contributor
|
Please reformat the code first using our formatter rules to make it easier to evaluate your proposed changes |
Contributor
|
I'm wondering what the use case of this change would be. Wouldn't the target file be worthless if parts of the source is missing? Is this for a school / university project, or is this part of an AI training / evaluation? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR Does
This pull request improves the robustness and debuggability of
PDFMergerUtilityby:Adding a
skipCorruptFilesflagWrapping
IOExceptionwith source contextApplied consistently in both merge modes
optimizedMergeDocuments(...)legacyMergeDocuments(...)Why This Helps
setSkipCorruptFiles(true).