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

ENH: Enhance PDF Merging Capabilities for Nested Bookmarks - Addresses Issue #2305 #2603

Closed
wants to merge 1 commit into from

Conversation

mrishav
Copy link

@mrishav mrishav commented Apr 19, 2024

This PR addresses Issue #2305 by enhancing the PDF merging capabilities of PyPDF, specifically focusing on the handling of nested bookmarks.

Changes Made:

  • Modification to Existing Merging Logic: The merging functions in pypdf/generic/__init__.py have been updated to better manage nested bookmarks. This ensures that the hierarchical structure of bookmarks is maintained accurately during the merge process.
  • New File Addition (_annotation_formats.py): Introduced a new module to support additional annotation formats. This enhancement aids in the preservation of annotations during the merging process, ensuring that no data is lost and annotations are correctly aligned in the merged document.

@mrishav mrishav changed the title Resolved Issue #2305: Enhance PDF Merging Capabilities ENH: Enhance PDF Merging Capabilities for Nested Bookmarks - Addresses Issue #2305 Apr 19, 2024
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 9.37500% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 94.59%. Comparing base (1d8d3be) to head (e3a55a5).

Files Patch % Lines
pypdf/generic/_annotation_formats.py 0.00% 23 Missing ⚠️
pypdf/generic/__init__.py 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2603      +/-   ##
==========================================
- Coverage   94.92%   94.59%   -0.33%     
==========================================
  Files          50       51       +1     
  Lines        8316     8348      +32     
  Branches     1667     1673       +6     
==========================================
+ Hits         7894     7897       +3     
- Misses        261      290      +29     
  Partials      161      161              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stefan6419846
Copy link
Collaborator

Thanks for the PR. Could you please fix the formatting and add corresponding tests to ensure that (preferably) all your changes are covered accordingly?

@pubpub-zz
Copy link
Collaborator

@mrishav
The annotation builder is under deprecation process in favor of https://pypdf.readthedocs.io/en/stable/user/adding-pdf-annotations.html

Can you review the new approach to confirm the issue or not.

Also can you add documentation for your added code.

@stefan6419846 stefan6419846 added needs-change The PR/issue cannot be handled as issue and needs to be improved needs-test A test should be added before this PR is merged. labels Apr 28, 2024
@mrishav mrishav closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-change The PR/issue cannot be handled as issue and needs to be improved needs-test A test should be added before this PR is merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants