Repository navigation
Add opt-in drawing PDF views and Markdown reports - #2689
Draft
Çağdaş Yürekli (cagdasyurekli) wants to merge 1 commit into
Draft
Çağdaş Yürekli (cagdasyurekli) wants to merge 1 commit into
Çağdaş Yürekli (cagdasyurekli) wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vector drawing PDFs can return successful Markdown containing only isolated labels, while SHX annotation text and all drawing lines are omitted. Add an explicit, local
--pdf-drawing-mode/pdf_drawing_mode=Truepath that returns located native/SHX labels, raster page views, and an English Markdown limitations report. Existing conversion defaults remain unchanged. This draft is a concrete proposal for review; core/plugin placement and API/report shape have not been accepted by maintainers.CLI:
markitdown drawing.pdf --pdf-drawing-mode -o drawing.mdproducesdrawing.md,drawing.report.md, anddrawing.assets/page-1.png, etc. New destinations only; collisions, symlinks, and source overwrites are refused. Output is staged, published through exclusive hard links, and rolled back on failure. Destination filesystems must support hard links.--conversion-reportselects a different report path. Stdout requires explicit--keep-data-urisplus a report path.The API exposes
result.assetsandresult.conversion_reportwithout filesystem writes. ZIP members retain distinct image names and reports; failed drawing rendering is not silently skipped or downgraded to successful text-only conversion. The optional MCP argument returns inline views and the report, with no file writes. Drawing mode runs before PDF plugin/cloud fallback selection; CLI cloud-mode combinations are rejected.This is not lossless or semantic drawing reconstruction. PNG views use the CropBox at up to 200 DPI with an 8192-pixel longest-edge cap; fine detail can be lost. Reports give MediaBox/CropBox bounds and identify unresolved information without claiming exhaustive detection. No OCR, dimension associations, unit/scale inference, or external model calls. Angled lettering can have imperfect word grouping. The complete assets map is held in memory, and large drawings can be resource-heavy. Clients must provide image pixels to visual consumers explicitly.
Validation (Python 3.12):
git diff --checkpassed. OCR/MCP suites run separately because their test package names collide in a combined invocation.Scope: net +338 production lines, +342 test lines, +59 documentation lines. Growth adds drawing extraction, safe output publication, and integration/regression coverage. No new runtime/test dependencies. Independent from the opt-in rejection/warning PR #2668. Related overlapping proposals: #1398 (bbox JSON/OCR) and #2055 (embedded image extraction).
Refs #2688. This is a separate RFC/draft contribution; it does not imply maintainer approval of core placement or sidecar behavior.