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: Add link annotation #1189

Merged
merged 12 commits into from
Jul 31, 2022
Merged

ENH: Add link annotation #1189

merged 12 commits into from
Jul 31, 2022

Conversation

MartinThoma
Copy link
Member

@MartinThoma MartinThoma commented Jul 31, 2022

  • Add AnnotationBuilder.link(...)
  • Allow creating a RectangleObject from a RectangleObject. This is useful to create a copy or to ensure we have a RectangleObject with little code.
  • Deprecate writer.add_link by writer.add_annotation(AnnotationBuilder.link(...)).
  • Add test for reading an external link annotation.

Closes #284

@codecov
Copy link

codecov bot commented Jul 31, 2022

Codecov Report

Merging #1189 (64f17af) into main (2a5a199) will increase coverage by 0.06%.
The diff coverage is 97.22%.

@@            Coverage Diff             @@
##             main    #1189      +/-   ##
==========================================
+ Coverage   92.07%   92.13%   +0.06%     
==========================================
  Files          24       24              
  Lines        4894     4910      +16     
  Branches     1011     1016       +5     
==========================================
+ Hits         4506     4524      +18     
  Misses        244      244              
+ Partials      144      142       -2     
Impacted Files Coverage Δ
PyPDF2/_writer.py 88.16% <90.00%> (-0.02%) ⬇️
PyPDF2/generic.py 91.77% <100.00%> (+0.20%) ⬆️
PyPDF2/_page.py 92.62% <0.00%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a5a199...64f17af. Read the comment docs.

@MartinThoma MartinThoma marked this pull request as draft July 31, 2022 12:08
@MartinThoma MartinThoma marked this pull request as ready for review July 31, 2022 13:10
@MartinThoma MartinThoma merged commit ab01f14 into main Jul 31, 2022
@MartinThoma MartinThoma deleted the link-annotation branch July 31, 2022 15:03
MartinThoma added a commit that referenced this pull request Jul 31, 2022
New Features (ENH):
-  Add ability to add hex encoded colors to outline items (#1186)
-  Add support for pathlib.Path in PdfMerger.merge (#1190)
-  Add link annotation (#1189)
-  Add capability to filter text extraction by orientation  (#1175)

Bug Fixes (BUG):
-  Named Dest in PDF1.1 (#1174)
-  Incomplete Graphic State save/restore (#1172)

Documentation (DOC):
-  Update changelog url in package metadata (#1180)
-  Table extraction (#1179)
-  Mention pyHanko for signing PDF documents (#1178)
-  We now have CMAP support (#1177)

Maintenance (MAINT):
-  Consistant usage of warnings / log messages (#1164)
-  Consistent terminology for outline items (#1156)

Code Style (STY):
-  Apply pre-commit (#1188)

Full Changelog: 2.8.1...2.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Support reading link annotations
1 participant