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()
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