Repository navigation
Add opt-in drawing PDF views and Markdown reports - #2689
Open
Çağdaş Yürekli (cagdasyurekli) wants to merge 2 commits into
Open
Çağdaş Yürekli (cagdasyurekli) wants to merge 2 commits into
Çağdaş Yürekli (cagdasyurekli) wants to merge 2 commits into
Conversation
Çağdaş Yürekli (cagdasyurekli)
marked this pull request as ready for review
October 15, 2026 09:48
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 isolated labels while omitting drawing lines and SHX annotation text. 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 produces
drawing.md,drawing.report.md, anddrawing.assets/page-1.png, etc. Output destinations must be new; existing files, symlink destinations, and source overwrites are refused. Publication stages the files, creates destinations exclusively using hard links, and rolls back on failure. The filesystem must support hard links.--conversion-reportselects another report path; stdout requires explicit--keep-data-urisand a report path.The API returns
result.assetsandresult.conversion_reportwithout filesystem writes. ZIP members retain distinct image names and reports, and drawing render failures propagate instead of becoming successful text-only conversion. The optional MCP argument returns inline views and the report without file writes. Drawing mode runs before PDF plugin/cloud fallback selection; the CLI rejects combinations with Azure conversion flags.This is not lossless or semantic drawing reconstruction. CropBox page views use up to 200 DPI, capped at 8192 pixels on the longest edge; fine detail may be lost. Reports give MediaBox/CropBox bounds and limitations without claiming exhaustive detection. There is no OCR, unit/scale inference, dimension association, or external model call. Angled lettering may have imperfect word grouping. All page PNGs remain in memory, so large drawings can be resource-heavy. Visual consumers must receive image pixels explicitly.
Validation on the review candidate (Python 3.12):
git diff --checkpassed. Drawing tests now live in the existingtest_pdf.pyper the test-organization guide; all drawing test functions were preserved, and the MCP fixture reference was updated.Scope versus main: net +338 production lines, +337 test lines, and +59 documentation lines for the drawing path, safe output publication, and integration coverage; no new runtime or test dependencies. This readiness follow-up changes only test organization (net -5 lines).
Core/plugin placement and the public assets/report shape remain open to maintainer review. This contribution is independent of #2668; related overlapping proposals are #1398 and #2055.
Refs #2688.