-
Notifications
You must be signed in to change notification settings - Fork 254
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
Allow to insert screen-only images that do not get printed #441
Comments
I would like to take up the issue! |
Awesome, great! There are a few pointers:
|
Hey! @Lucas-C (Ps:- I'm sorry for asking so many questions) |
For detailed explanations, please refere to the 1.7 PDF spec.
This method currently contains a call to
That's the idea yes! I suggest the following approach:
I don't understand this question, sorry.
Please don't excuse yourself for asking questions! The presence of the Thank you for your interest in implementing this! |
@Brianrmendes: are you still working on this feature, or is it up-for-grabs for another contributor to implement this? |
@Lucas-C Hey! I'm sorry for the delay, I've been having submissions and exams lately in my college. I'm working on it though! |
OK, great 😊 I hope your exams will go fine! |
Hi @Brianrmendes! |
We can absolutely let potential hacktoerfest participants take part in this! I'm having a hard time in solving the issue, so it would be great to see how others approach this issue! |
So I was looking at this issue yesterday and tried to implement a nested ViewOnly/PrintOnly dictionary into the properties entry directly as Lucas suggested but that seems to create very unreadable deeply nested code -
So I can either create the ViewerOnly/PrintOnly dictionaries separately and just embed them into the properties dict like so -
Or I can define separate pdf objects and pass them as a reference into the properties dict (this is the approach Lucas said to avoid as it creates extra pdf objects but seems cleaner to me) What do you guys think? @Lucas-C @gmischler |
This seems like the best option to me 😊 |
Hi @devdev29! Are you still working on this feature? 😊 Otherwise, no worries, but it may be worth mentioning it so that other contributors could consider working on this |
Heyy, I'm still working on it but had a hectic summer, but of course other contributors are welcome to work on it since I'm not sure when I'll be able to finish on it. (I probably should've mentioned this sooner, my bad😶🌫️) |
Alright, no worries! 😊👍 I wish you a great summer! |
Hi Lucas, |
You are very welcome to tackle this issue, thank you! Given the last message from @devdev29, I think this totally fine for you to submit a PR to implement this. Are you willing to contribute as part of hacktoberfest? If you have any questions, go on and ask 🙂 |
Yes sure, Lucas, I can contribute as part of Hacktoberfest. I am working on it, but only after my fulltime work is over and maybe some time in weekends, have some questions also, will ask you in some time, as I get more organized in my thoughts, as to what i need to ask. Still exploring the code though.. |
The idea comes from one of @digidigital recipes: https://github.com/digidigital/Extensions-and-Scripts-for-pyFPDF-fpdf2/tree/main/visibility (cf. #274)
To implement this feature,
fpdf2
will need to insert Optional Content Groups, and Optional Content Usage Dictionaries.Example from the spec:
There is some usage example in Python, once implemented:
visibility
would be an optional parameter that could also receive the value "PrintOnly",meaning that the image would be only displayed when printed.
By implementing this feature you, as a benevolent FLOSS developper, will provide access to the large community of fpdf2 users to a useful PDF functionality.
As a contributor you will get review feedbacks from maintainers & other contributors, and learn about the lifecycle & structure of a Python library on the way.
You will also be added into the contributors list & map.
This issue can count as part of hacktoberfest
The text was updated successfully, but these errors were encountered: