Updating Annotations #3577
Replies: 4 comments 5 replies
-
This is not a bug / issue but a Discussions item. |
Beta Was this translation helpful? Give feedback.
-
More information is needed to develop an opinion here. First of all a (small) PDF example and then the code used to achieve your goal. |
Beta Was this translation helpful? Give feedback.
-
Your approach is bound to fail. Why don't you switch to an approach that reads out the annotations from the source and interprets their properties for adding them in the target PDF using the standard API. |
Beta Was this translation helpful? Give feedback.
-
You should check the type of each original annotation. |
Beta Was this translation helpful? Give feedback.
-
Description of the bug
I have a script that copies information from annots to create identical ones on other pages.
This works great, however, the annots appear weird when opening the PDF document. It can be seen, that the annots have the correct information, but to show the correct appearance, I need to change any property of the annot (and then change it back)
I think that the issue has something to do with updating, however updating the annot and the page doesn't work.
Is there a solution to this problem?
How to reproduce the bug
The following methods are used:
the low level information is copied using doc.xref_object(xref)
a "dummy" annot is created using page.add_rect_annot() (or any other annot)
the annot is updated with the information using doc.update_object()
PyMuPDF version
1.24.2
Operating system
Windows
Python version
3.11
Beta Was this translation helpful? Give feedback.
All reactions