Context
Docling is adding PDF embedded file / attachment processing.
docling-parse needs an API that exposes embedded file streams and the positions of FileAttachment annotations.
Proposed API
On the document-level parser:
list_embedded_files() -> list[EmbeddedFile] where each item carries:
name: str
mime_type: Optional[str]
size: int
bytes: bytes
list_attachment_annotations() -> list[AttachmentAnnotation] where each item carries:
page_index: int
bbox: BoundingBox (or equivalent rect struct used elsewhere in the API)
file_name: str — reference to the embedded file name
Backward compatibility
New methods; existing parser APIs unaffected.
Implementation will be opened as a PR from fork: yonikremer/docling-parse feat/attachments.
Context
Docling is adding PDF embedded file / attachment processing.
docling-parse needs an API that exposes embedded file streams and the positions of FileAttachment annotations.
Proposed API
On the document-level parser:
list_embedded_files() -> list[EmbeddedFile]where each item carries:name: strmime_type: Optional[str]size: intbytes: byteslist_attachment_annotations() -> list[AttachmentAnnotation]where each item carries:page_index: intbbox: BoundingBox(or equivalent rect struct used elsewhere in the API)file_name: str— reference to the embedded file nameBackward compatibility
New methods; existing parser APIs unaffected.
Implementation will be opened as a PR from fork: yonikremer/docling-parse feat/attachments.