PDF Processor for VS Code
Open PDF files directly in VS Code. Extract tables, text, and images with layout fidelity. Compare two PDFs side by side. Edit the extracted HTML in a built-in Monaco editor. Everything runs locally with no file upload.

Table of Contents
Install and use
- Install this extension.
- Right-click any
.pdf file in Explorer.
- Pick "Open with PDF Processor."
The PDF opens in a VS Code custom editor with five views:
| View |
What it shows |
| PDF |
Native PDF.js canvas with pinch-zoom, page navigation, accurate render |
| Doc |
Rendered HTML extraction with preserved layout, tables, images, columns |
| Visual Diff |
Side-by-side PDF vs extracted HTML with page-synchronized scroll |
| Editor |
Monaco code editor on the extracted HTML, with live preview to the Doc view |
| Compare Diff |
Load a second PDF and diff them: split or unified, word + character level |
Commands
| Command |
What it does |
Ginexys: Open PDF Processor |
Open a .pdf file in the custom editor |
Ginexys: Extract Text from PDF |
Open straight to the Analyze tab |
Ginexys: View PDF |
Open in PDF canvas view |
Ginexys: Edit PDF Content |
Open the Monaco editor on the extracted HTML |
Each command also appears in the Explorer context menu and editor title menu for .pdf files.
File types
.pdf · .html
PDF files open with full extraction: PDF canvas, Doc view, Visual Diff, Monaco editor, Compare Diff, and Analyze tab. HTML files open via "Open With" into the Doc and Editor tabs for editing and comparison. Compare Diff accepts any combination of PDF, HTML, and Markdown as the two documents being diffed.
Works on text-native PDFs (born digital, exported from Word, InDesign, or LaTeX), scanned PDFs with an OCR text layer, and hybrid PDFs that combine text and embedded raster. For pure image-only PDFs without a text layer, Advance Extraction (Pro) routes through Docling for OCR.
Why this extension exists
Most PDF extraction tools either upload your file to a cloud service or strip layout completely and hand back a wall of text. Neither is acceptable for engineering documents, financial reports, lab results, or anything with tables you actually need to keep intact. PDF Processor was built for a specific niche: deterministic geometric reasoning over PDF.js text streams, running in a Web Worker, all on your machine.
The four architectural commitments below are load-bearing.
- No backend dependency. Extraction runs in your VS Code window. The PDF never leaves your machine. Standalone extraction never hits a network.
- No ML model weights. No multi-gigabyte downloads. The geometry pipeline is deterministic, so the same input always produces the same output.
- No raster intermediate. Text positions come from the PDF's own text operators (PDF.js
getTextContent), not from rendering pixels and reading them back. Glyph fidelity is preserved.
- Deterministic geometry. Column detection, table reconstruction, and zone assembly use bipartite reasoning, vertical-rule detection, and struct-tree reading order. No heuristics that change between runs.
The full argument is in Finding the niche: where frontend-first PDF extraction actually fits, a design-space survey of pdf2htmlEX, tesseract.js, transformers.js with layout-yolo, and pdfreader. The four commitments above are derived from that comparison.
Engine deep-dive
PDF Processor is built as five composable engines, each addressing one well-defined problem. Each has a public deep-dive post explaining the algorithm, the failure modes it avoids, and the trade-offs we accepted.
1. Path reconciler: turning PDF path operators into clean segments
PDF path operators are not segments. They are instructions for a stateful drawing machine: m x y moves the cursor, l x y strokes to a new cursor, re opens a rectangle subpath, h closes it, all under the current transformation matrix. A naive reader sees noise. A correct one rebuilds analytic geometry. Our path reconciler captures the CTM per-subpath in the adapter, reconciles subpath geometry analytically in the reconciler, and merges fragmented dashes via global partition.
2. Bipartite column detector: finding gutters without histograms
Most column detectors fail because they treat spatial gaps as structural evidence. Histogram approaches "fill in the gap before you can measure it." The correct model is graph-theoretic: find an X coordinate that partitions text bands into two populations with no crossing members. We pair that with a three-gate confidence test (gutter width, band coverage, column balance) before promoting a candidate to a real split.
3. Struct-tree reader: using the PDF's own reading order
When PDFs ship with a logical structure tree (/StructTreeRoot), it tells you exactly which text items belong to which <Table>, <TR>, <TD>, paragraph, or heading, and in what reading order. We pre-claim these regions before geometry runs, so the deterministic geometry pipeline only operates on unclaimed content. This is Tier 1 of the three-pass extraction pipeline.
4. Page assembler: turning classified regions into HTML
After geometry runs, you have a list of classified regions: text bands, columns, table frames, image bboxes. Turning that into correct HTML requires three things that most implementations skip: proportional column widths from measured gutter positions, zone boundaries derived from content top edges (not midpoints), and a zone content classifier that picks the right CSS layout pattern per zone. Each has a specific failure mode if you skip it.
5. HTML-as-CAD editor: treating the output as editable geometry
Once a page is rendered as HTML, you can either treat it like a static document (what most tools do) or like CAD, where every element has a position and you can drag, group, and snap it with full control. Our Selection Mode pulls that off in the browser using SVG overlays and position:absolute handles that preserve the underlying layout.
Read more
Full source for these engines lives at tools/pdf-processor/src/extraction/vector/ in the doc-extractor repository.
Key features
- Browser-native extraction. High-speed PDF parsing via PDF.js running in a local Web Worker. No main-thread blocking, no network call.
- Three-pass extraction pipeline. Struct tree (when present), then vertical rule detection, then bipartite column detection. The highest-confidence signal wins per page.
- Layout-preserved HTML output. Tables, headings, lists, images, multi-column flows, and page zones are all reconstructed with CSS that mirrors the source.
- Visual Diff. IntersectionObserver-driven page sync between the original PDF and the rendered Doc, so when you scroll on one side the other follows.
- Compare Diff. Load two documents (PDF, HTML, or Markdown) and see a line-by-line diff with gutters, row backgrounds, and inline word/char marks. Split or unified view with synchronized scroll. Catches every changed clause in a redline.
- Built-in Monaco editor. Refine the extracted HTML and watch the Doc view update live (300ms debounce). Same Monaco that ships in VS Code.
- Selection Mode. Treat the rendered HTML like CAD. Drag zones and regions, group them into columns, apply Bootstrap-style layouts. Real positions, not approximations.
- Image extraction. Embedded raster images are pulled out at native resolution with proper bbox positions. Figures keep their captions.
- Export to many formats. Markdown, HTML, DOC, XML, JSON as direct downloads. Notion and Google Sheets export (Pro).
- Zero data upload. All free-tier processing happens locally. No telemetry. No PDFs ever leave your machine.
| Format |
Use case |
| Markdown |
GitHub docs, MkDocs, Docusaurus, blog ingest |
| HTML |
Web publishing, Confluence, knowledge bases |
| DOC |
Word import, downstream Office workflows |
| XML |
Structured data pipelines, archival, schema ingest |
| JSON |
Tabular data extraction, programmatic post-processing |
| Notion (Pro) |
Direct push to Notion pages with table fidelity |
| Google Sheets (Pro) |
Table-only extraction straight to a new Sheet |
Keyboard shortcuts
| Shortcut |
Action |
| Mouse wheel |
Scroll synchronized pages in Visual Diff |
| Drag a region in Selection Mode |
Define a zone |
Shift+click zone |
Group into a column |
Ctrl/Cmd+S (in Editor view) |
Save the HTML edits back to the workspace |
Who uses this
- Engineers and researchers. Extract tables and figures from technical papers, datasheets, and lab reports without losing column structure.
- Financial analysts. Pull tables from quarterly reports, prospectuses, and 10-Ks straight into Excel-ready CSV or JSON.
- Legal and compliance teams. Visual Diff and Compare Diff catch redlines and amendments across contract versions.
- Technical writers. Convert legacy PDF docs into Markdown or HTML for modern docs platforms.
- Data engineers. Programmatic JSON output as the first stage of an ingest pipeline. Combined with TAFNE for downstream reshaping.
Pro features
Some features require a Ginexys Pro account:
- Advance Extraction. AI-powered layout analysis via Docling and OpenRouter for tough scans and unusual layouts. Currently a waitlist feature.
- Analyze tab. Per-region confidence scores, zone flag inspector, tolerance controls, and per-page re-extraction.
- Export to Notion. Push extracted documents straight into Notion pages with table fidelity.
- Export to Google Sheets. One-click push of extracted tables to a new Google Sheet.
- Visual Diff report export. Full PDF diff report as a downloadable PDF or HTML.
Free extraction runs at full quality. Pro features are clearly marked with a gold PRO badge.
Requires
Ginexys Core Extension is a dependency. VS Code installs it automatically.
Part of the Ginexys pipeline
PDF Processor is the Extract step:
Extract (PDF/image to structured data) PDF Processor (this extension)
v
Transform (reshape, edit, clean) TAFNE
v
Engineer (schematic / topology editor) Schema Editor
Get the whole pipeline: Ginexys Developer Tools.
Privacy
PDFs never leave your machine. Extraction runs entirely in a local Web Worker. The extension contains no telemetry. Pro features that route through Ginexys backend (Docling, OpenRouter) only run when you explicitly enable Advance Extraction on a specific file, and only that file's content is sent.
License
MIT. See LICENSE.
Source and issues
github.com/carnworkstudios/doc-extractor
Web version
Browser version at ginexys.com/tools/pdf-processor. Same extraction pipeline, no install.