Select new text objects after adding
This commit is contained in:
@@ -206,7 +206,7 @@ class PdfDocument:
|
||||
page_index: int,
|
||||
text: str,
|
||||
point: tuple[float, float] | None = None,
|
||||
) -> None:
|
||||
) -> AnnotationInfo:
|
||||
self.snapshot()
|
||||
page = self._page(page_index)
|
||||
x0, y0 = point or (72, 96)
|
||||
@@ -226,6 +226,13 @@ class PdfDocument:
|
||||
annot.set_info(content=text)
|
||||
annot.update()
|
||||
self.mark_changed()
|
||||
return AnnotationInfo(
|
||||
page_index=page_index,
|
||||
xref=annot.xref,
|
||||
annotation_type=annot.type[1],
|
||||
content=text,
|
||||
rect=self._rect_tuple(annot.rect),
|
||||
)
|
||||
|
||||
def add_text_stamp(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user