Replies: 3 comments 6 replies
-
Probably no bug: |
Beta Was this translation helpful? Give feedback.
-
Otherwise, your statement The rectangle that is read from the PDF should have the same size as the rectangle that is used to set the annotation. is wrong. rectangle = fitz.Rect(10, 10, 20, 20)
annot=page.add_circle_annot(rect=rectangle)
print(annot.rect) prints this: You can enforce things like this: rectangle = fitz.Rect(10, 10, 20, 20)
annot = page.add_circle_annot(rect=rectangle)
annot.set_border(width=0)
annot.update()
print(annot.rect) which prints the original |
Beta Was this translation helpful? Give feedback.
-
Sorry, I am not sure what Also I realized I forgot some pieces of information sorry: the code I sent actually worked with PyMuPDF version 1.21.1, but does not with 1.22.3. So the assert was not failing, and rectangle = fitz.Rect(10, 10, 20, 20)
annot=page.add_circle_annot(rect=rectangle)
print(annot.rect) prints Regarding your suggestion, it is a nice workaround, thanks. I am just surprised that when we draw we use the inner rectangle and when we read we get the outer one. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug (mandatory)
When adding an annotation to a page using
page.add_circle_annot
, a rectangle can be given to set its size. However, when retrieving the size of the annotation, the rectangle has a different size, namely a bit larger.To Reproduce (mandatory)
Expected behavior (optional)
The rectangle that is read from the PDF should have the same size as the rectangle that is used to set the annotation.
Your configuration (mandatory)
3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0]
linux
PyMuPDF 1.21.1: Python bindings for the MuPDF 1.21.1 library.
Version date: 2022-12-13 00:00:01.
Built for Python 3.10 on linux (64-bit).
Beta Was this translation helpful? Give feedback.
All reactions