Add annotation object selection editing

This commit is contained in:
2026-06-29 17:48:48 +08:00
parent bf9e8fb7cd
commit a23b2cc366
6 changed files with 310 additions and 13 deletions
+4
View File
@@ -79,6 +79,10 @@ def main() -> int:
assert document.delete_annotation(annotations[0].page_index, annotations[0].xref)
document.add_text(0, "PDFReaderLite")
document.add_text(0, "Placed text", (150, 160))
selected = document.annotation_at_point(0, (155, 165))
assert selected and selected.rect
x0, y0, x1, y1 = selected.rect
assert document.update_annotation_rect(0, selected.xref, (x0 + 10, y0 + 10, x1 + 30, y1 + 30))
document.insert_image(0, image_path)
document.insert_image(0, image_path, (180, 200))
document.add_signature(0, image_path)