-
Notifications
You must be signed in to change notification settings - Fork 614
Stroke color of annotations cannot be correctly set #4447
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Please add the pdf file |
Due to company policy, I am unable to provide the original PDF file. I have added a dummy pdf file instead, I think you can reproduce the bug on it |
Actually don't worry, i think i've reproduced the problem with a blank document. |
As per the PDF specification, FreeText annotations only support one color in their object definition ( |
FreeText annotations often have 3 different colors: fill, border and text color - which is completely beyond what PDF object definition syntax lets you do. |
I think we need to explain this better in the documentation - i.e. discourage the use of |
Thanks, I will try rich text annot instead |
border color can be correctly set with |
Reopening this until we've released some improvements in this area - to the documentation, and to raise an exception if a text annotation cannot handle the desired colors. |
I found it can display the correct text color, fill color, and border color with |
…olor. Annot.update() now raises exception of border_color specified if not rich text, matching Annot.__init__(). Also test exceptions are raised as expected. Addresses #4447.
…olor. Annot.update() now raises exception of border_color specified if not rich text, matching Annot.__init__(). Also test exceptions are raised as expected. Addresses #4447.
Fixed in PyMuPDF-1.26.0. |
Uh oh!
There was an error while loading. Please reload this page.
dummy.pdf
Description of the bug
When I use
annot.set_colors(stroke=(0, 0, 0))
to set annotations' border color to black, the fill color of the annotations are changed to black instead. The border color remains the same as the text color.How to reproduce the bug
Expected behavior:
The border of the annotation should be black, and the fill color should remains light blue
Actual behavior:
The fill of the annotation is set to black, while the border color is the same as the text color
PyMuPDF version
1.25.4
Operating system
Windows
Python version
3.13
The text was updated successfully, but these errors were encountered: