Skip to content

Handle duplicate widget names when joining PDFs #4347

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

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

JorjMcKie
Copy link
Collaborator

Previously, in some constellations duplicated fields on source pages (i.e. having a common parent) were not correctly copied over to the target PDF. In addition, when source widgets happened to have same names as present in the target, invalid widgets resulted in the merged PDF.

This fix copies all root widgets to the target in a separate first step. Only any root fields in source pages are separately copied over.

Finally, name duplicates are resolved by either renaming source widgets, or (option) joining them with target widgets in common /Kids arrays.

Previously, in some constellations duplicated fields on source pages (i.e. having a common parent) were not correctly copied over to the target PDF.
In addition, when source widgets happened to have same names as present in the target, invalid widgets resulted in the merged PDF.

This fix copies all root widgets to the target in a separate first step.  Only any root fields in source pages are separately copied over.

Finally, name duplicates are resolved by either renaming source widgets, or (option) joining them with target widgets in common `/Kids` arrays.
@JorjMcKie JorjMcKie force-pushed the improve-field-mergers branch from 2862ce9 to 29fac61 Compare March 5, 2025 14:12
@JorjMcKie JorjMcKie merged commit 261415e into main Mar 6, 2025
2 checks passed
@JorjMcKie JorjMcKie deleted the improve-field-mergers branch March 6, 2025 12:42
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants