-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Add page-level actions #3382
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
base: main
Are you sure you want to change the base?
Conversation
Sets entries in a page object’s additional-actions dictionary.
Ideally want to be able to add open and close actions. To avoid a future deprecation, can we add this as |
I do not understand what you are referring to. Could you please elaborate? |
I could have described better...
Currently adds either open or close page action. To be able to add both will require modifying the function signature. Or maybe change it so that if given an open action keeps any close action and vice versa. |
We shouldn't have public API that is internal as it might break in the future. Do you have an actual use case for implementing this? Or is this just because the implementation allows this? I have to be honest that I personally never actively used Javascript in PDF files. |
Let me know if you have a good way to modify this, or the functionality requirements needed. Currently use the catalog OpenAction but the JavaScript at page-level is more flexible to only run the JavaScript once opening or closing a page. Will also do a new PR for these tests, as could be in same function? pypdf/tests/test_javascript.py Lines 23 to 51 in 5252c2f
|
I am not completely sure if I can follow you here, but I would just let the user pass the NameObject and document the basics.
Sorry, but I am rather confused what you want to say/ask with this. |
That a good way forward. So the function will take a For the catalog OpenAction tests, test_added_js and test_add_js could be merged as they are doing similar things. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3382 +/- ##
=======================================
Coverage 96.94% 96.94%
=======================================
Files 55 55
Lines 9333 9341 +8
Branches 1708 1709 +1
=======================================
+ Hits 9048 9056 +8
Misses 170 170
Partials 115 115 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sets entries in a page object’s additional-actions dictionary.