Add unsaved changes prompts

This commit is contained in:
2026-06-29 18:24:59 +08:00
parent cc31574830
commit 9d57117094
5 changed files with 68 additions and 7 deletions
+3
View File
@@ -62,6 +62,7 @@ def main() -> int:
document = PdfDocument()
document.open(source_pdf)
assert not document.is_dirty
assert document.render_page(0, 1.0).width() > 0
assert document.render_page(0, 1.0).width() > 0
assert document.search("feature")
@@ -74,6 +75,7 @@ def main() -> int:
assert document.strikeout_text(0, "feature") == 1
document.add_note(0, "note")
assert document.is_dirty
annotations = document.annotations()
assert annotations
assert document.delete_annotation(annotations[0].page_index, annotations[0].xref)
@@ -118,6 +120,7 @@ def main() -> int:
allow_modify=False,
)
document.save()
assert not document.is_dirty
document.close()
encrypted_document = PdfDocument()