Repository: 0xabu/pdfannots (language: python)

Issue:
Support "FreeText" annotations
The text annotation tool in the PDF Expert app creates annotations of subtype "FreeText". `pdfannots.py` doesn't support these, it complains "WARNING: Unsupported FreeText annotation ignored on page 1". It could support these annotations just like "Text" (sticky note) annotations.


Discussion / hints:

Fix patch:
diff --git a/pdfannots/types.py b/pdfannots/types.py
index 27c22f4..8022b94 100644
--- a/pdfannots/types.py
+++ b/pdfannots/types.py
@@ -248,6 +248,9 @@ class AnnotationType(enum.Enum):
     # highlights. We do not attempt to capture the affected text.
     Square = enum.auto()
 
+    # Free-form text written somewhere on the page.
+    FreeText = enum.auto()
+
 
 class Annotation(ObjectWithPos):
     """


Test patch:
diff --git a/tests/FreeText-annotation.pdf b/tests/FreeText-annotation.pdf
new file mode 100644
index 0000000..fae3867
Binary files /dev/null and b/tests/FreeText-annotation.pdf differ