Feature request: reject known CAD-exported PDFs when partial text extraction is unacceptable
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 36/100
調査の方向性
Open PR #2668 already targets this issue, so check its state and the thread before starting any work. The change spans three areas: the conversion entry point where the reject_cad_pdfs keyword is accepted, the CLI parser that must add --reject-cad-pdfs, and the PDF converter path where Creator/Producer metadata is inspected before a converter (or plugin/cloud converter) is selected. Done looks like known CAD exporters raising an actionable exception, unchanged default extraction otherwise, plus the generated-PDF regression tests covering labeled and geometry-only drawings, unknown metadata, non-PDF inputs, plugins and CLI file/stdin rejection.
索引モデルが issue の本文から書いたものです。
説明
CAD-exported PDFs can produce successful but incomplete Markdown because drawing geometry is not represented in the output. Can MarkItDown offer an explicit rejection policy for callers who cannot accept this loss?
Observed behavior
Tested current main at 4cc9fa17653d695d64fb9eee5b33d4de55ff84e8 with synthetic, valid vector PDFs (not files exported by an installed CAD application):
- A floor plan with vector room outlines and embedded
ROOM A/ROOM Blabels converts successfully, returning the labels without the room outlines or spatial relationships. - A geometry-only variant also returns successfully, with effectively empty output.
- Enabling the OCR plugin does not recover the labeled vector plan: it contains extractable text but no embedded raster images, so the plugin follows its text extraction path. This was tested locally without invoking an external model.
Autodesk also documents that SHX text may be exported as geometry, comments, or hidden text. This creates a second way for plain text extraction to omit content:
https://help.autodesk.com/cloudhelp/2024/ENU/AutoCAD-Core/files/GUID-56EA988C-A1DA-4E85-8765-B3F31A01AB02.htm
Proposed bounded fix
Add --reject-cad-pdfs and the conversion keyword reject_cad_pdfs=True. Check PDF Creator/Producer metadata for explicitly named CAD exporters before selecting a converter. Reject known matches with an actionable exception, including when plugins or cloud converters are enabled. Preserve existing extraction behavior when the policy is not requested.
This is an exporter-based policy, not a drawing classifier or a guarantee of conversion fidelity. Missing/rewritten metadata and unrecognized exporters cannot be detected by it. It may also reject text-heavy documents exported by those applications; the caller explicitly chooses that conservative policy. A line-count heuristic would misclassify tables and ordinary charts.
Full drawing interpretation would require a separate rendered-page/vision workflow and validation; OCR alone cannot guarantee dimensions, topology, or geometric relationships. I am proposing the small rejection feature rather than claiming faithful drawing conversion.
Regression coverage
Use generated PDFs with correct xref offsets to cover labeled and geometry-only drawings, Creator/Producer identification, unknown metadata, unchanged default extraction, non-PDF inputs, plugins, and CLI file/stdin rejection before writing output.
Related: #296 discusses general PDF fidelity. I found no CAD/AutoCAD/SHX-specific issue or PR in the repository searches.
- 主要言語
- Python
- スター
- 198k
- フォーク
- 15k
- 平均マージ
- 2時間 16分
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/markitdown のほかの issue
-
IpynbConverter uses a comment inside a Markdown code fence as the notebook title対応中かも @Primaverah が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
microsoft/markitdown#2964 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
PPTX image alt text ending in a backslash breaks the Markdown image対応中かも @dongyikuan919 が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/markitdown#2943 ·
メンテナーはふだん 1 日以内に返信
-
PPTX chart labels with pipes or line breaks produce malformed Markdown tables対応中かも @dongyikuan919 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
microsoft/markitdown#2937 ·
メンテナーはふだん 1 日以内に返信
-
DOCX: math pre-processing re-parses every document.xml even without equations (32 s -> 17.5 s on a 12.5 MB document)対応中かも @houyunsun が 26 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
microsoft/markitdown#2834 ·
メンテナーはふだん 1 日以内に返信
-
URL fetch sends default python-requests User-Agent, Wikipedia returns 403対応中かも @sushan5140 が 31 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/markitdown#2820 ·
メンテナーはふだん 1 日以内に返信
microsoft/markitdown の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
hugohe3/ppt-master#366 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 89/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
521xueweihan/HelloGitHub#4716 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
pcqpcq/open-source-android-apps#619 ·
メンテナーはふだん 1 日以内に返信
-
contribution Windows 主机
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Lee-xeo/Claude-Cage#1519 ·
メンテナーはふだん 1 日以内に返信