feat: implement PDF page parsing, text extraction, and document modeling logic

This commit is contained in:
azeeee05
2026-07-07 19:03:11 +05:30
parent a383bd8704
commit 99f87eb7cf
8 changed files with 109 additions and 24 deletions
+1
View File
@@ -112,6 +112,7 @@ def get_document_annotations(document_id: str) -> list[AnnotationResponse]:
timestamp=getattr(a, "timestamp", None),
pageIndex=a.page_index,
paths=[[{"x": p.x, "y": p.y} for p in stroke] for stroke in getattr(a, "paths", [])],
quadPoints=getattr(a, "quad_points", []),
fieldName=getattr(a, "field_name", None),
fieldValue=getattr(a, "field_value", None),
fieldType=getattr(a, "field_type", None),
+1
View File
@@ -14,6 +14,7 @@ class AnnotationResponse(BaseModel):
timestamp: str | None = None
pageIndex: int
paths: list[list[dict[str, float]]] = []
quadPoints: list[list[dict[str, float]]] = []
fieldName: str | None = None
fieldValue: str | None = None