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 AnnotationBuilder.popup #1665

Merged
merged 18 commits into from
Mar 26, 2023
Merged

ENH: Add AnnotationBuilder.popup #1665

merged 18 commits into from
Mar 26, 2023

Conversation

pubpub-zz
Copy link
Collaborator

@pubpub-zz pubpub-zz commented Feb 26, 2023

fixes #1195
refactored bas on previous proposal and get open workink

See #107

@codecov
Copy link

codecov bot commented Feb 26, 2023

Codecov Report

Patch coverage: 77.27% and project coverage change: -0.06 ⚠️

Comparison is base (20ebcfd) 92.44% compared to head (bd16e55) 92.38%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1665      +/-   ##
==========================================
- Coverage   92.44%   92.38%   -0.06%     
==========================================
  Files          34       34              
  Lines        6538     6553      +15     
  Branches     1296     1300       +4     
==========================================
+ Hits         6044     6054      +10     
- Misses        323      326       +3     
- Partials      171      173       +2     
Impacted Files Coverage Δ
pypdf/generic/_annotations.py 93.69% <70.00%> (-2.39%) ⬇️
pypdf/_writer.py 86.12% <83.33%> (-0.11%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MartinThoma
Copy link
Member

Looks good to me - should I merge it? (I want to release in the next ~30 minutes) :-)

pypdf/_writer.py Outdated Show resolved Hide resolved
@MartinThoma
Copy link
Member

Ok, I think this one might need more discussion as there were a few changes besides the pure addition of the popup.

I'll make todays release without it so that we have time to discuss this :-)

@MartinThoma MartinThoma added soon PRs that are almost ready to be merged, issues that get solved pretty soon and removed soon PRs that are almost ready to be merged, issues that get solved pretty soon labels Feb 26, 2023
@MartinThoma MartinThoma changed the title ENH : add popup annots ENH: Add AnnotationBuilder.popup Mar 14, 2023
@MartinThoma MartinThoma added the is-feature A feature request label Mar 18, 2023
pypdf/_writer.py Outdated Show resolved Hide resolved
pubpub-zz and others added 3 commits March 18, 2023 18:25
Co-authored-by: Martin Thoma <info@martin-thoma.de>
@staticmethod
def popup(
rect: Union[RectangleObject, Tuple[float, float, float, float]],
flags: int = 0,
Copy link
Member

@MartinThoma MartinThoma Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we had an enum.IntFlag in constants.py for that. See the ObjectDeletionFlag in _writer.py and several examples in constants.py

pypdf/_writer.py Outdated Show resolved Hide resolved
pypdf/_writer.py Outdated Show resolved Hide resolved
pubpub-zz and others added 4 commits March 23, 2023 12:43
oups... too old PR

Co-authored-by: Martin Thoma <info@martin-thoma.de>
Co-authored-by: Martin Thoma <info@martin-thoma.de>
@MartinThoma MartinThoma added the soon PRs that are almost ready to be merged, issues that get solved pretty soon label Mar 24, 2023
@MartinThoma
Copy link
Member

MartinThoma commented Mar 24, 2023

Very nice work 👍 Two cleanups would be nice (removing the outdated check related to pagenum + using an enum.IntFlag), but I could do myself both if you want.

I want to include this in the coming release :-)

Co-authored-by: Martin Thoma <info@martin-thoma.de>
@pubpub-zz
Copy link
Collaborator Author

@MartinThoma
I think the flag which is global should be a candidate to a set_flag() in the same idea I've proposed in the PR about rectangle. Your opinion

pypdf/_writer.py Outdated Show resolved Hide resolved
pypdf/_writer.py Outdated Show resolved Hide resolved
@MartinThoma
Copy link
Member

@pubpub-zz I think the PR is good to be merged :-) Two small comments that I could change myself + the IntEnum flag (which I could also add myself).

Let me know if I should wait for you :-)

pubpub-zz and others added 3 commits March 25, 2023 09:25
Co-authored-by: Martin Thoma <info@martin-thoma.de>
Co-authored-by: Martin Thoma <info@martin-thoma.de>
@pubpub-zz
Copy link
Collaborator Author

@MartinThoma
All yours.

pypdf/_writer.py Outdated Show resolved Hide resolved
pypdf/_writer.py Outdated Show resolved Hide resolved
@MartinThoma MartinThoma merged commit 4fc0040 into py-pdf:main Mar 26, 2023
@MartinThoma
Copy link
Member

Thank you @pubpub-zz 🤗 The popup annotation will be part of pypdf==3.7.0 which I will release today 🎉

MartinThoma added a commit that referenced this pull request Mar 26, 2023
Security (SEC):
-  Use Python's secrets module instead of random module (#1748)

New Features (ENH):
-  Add AnnotationBuilder.highlight text markup annotation (#1740)
-  Add AnnotationBuilder.popup (#1665)
-  Add AnnotationBuilder.polyline annotation support (#1726)
-  Add clone_from parameter in PdfWriter constructor (#1703)

Bug Fixes (BUG):
-  'DictionaryObject' object has no attribute 'indirect_reference' (#1729)

Robustness (ROB):
-  Handle params NullObject in decode_stream_data (#1738)

Documentation (DOC):
-  Project scope (#1743)

Maintenance (MAINT):
-  Add AnnotationFlag (#1746)
-  Add LazyDict.__str__ (#1727)

[Full Changelog](3.6.0...3.7.0)
@pubpub-zz pubpub-zz deleted the popup2 branch June 24, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-feature A feature request soon PRs that are almost ready to be merged, issues that get solved pretty soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add popup annotation support
2 participants