How-to · PDF Extractor

Browser PDF Layout Analysis: Column Detection and Vector Shapes

How to run spatial PDF layout analysis, detect multi-column text baselines, lattice tables, and vector path shapes in JavaScript.

Open PDF Extractor Add to VS Code
Free · runs in your browser · your files are never uploaded

TLDR

Developers building PDF document parsers need to separate multi-column text baselines, lattice grid tables, stream whitespace tables, and closed vector shapes. Relying on raw character streams fails because PDFs store unordered text fragments pined to coordinates. GINEXYS PDF Processor analyzePanel.js exposes spatial threshold controls (Y-band, paragraph gap, column gap, stream confidence) to visually inspect and tune document layout analysis in real time.

The Search Query: PDF Layout Analysis and Column Detection

Developers frequently search for:

Understanding Layout Detection Parameters

PDF Processor categorizes document geometry using four interactive threshold parameters:

Parameter KeyUI SliderDefault ValueFunctional Role
R_Y_BANDY-Band Tol0.30Grouping text fragments into horizontal baseline rows
R_PARA_GAPPara Gap1.20Threshold distance to split text rows into separate paragraphs
R_COL_GAP_MINCol Gap Min1.50Minimum gutter width to separate parallel vertical columns
STREAM_CONFIDENCEStream Conf0.60Score threshold required to classify whitespace alignment as a table

Tuning Bipartite Column Splitter in Code

When a document features dense multi-column layouts, you can tune R_COL_GAP_MIN and place manual column splits directly on the canvas:

// Manual column split placement in analyzePanel.js
function _addManualSplit(colX) {
    if (!_manualSplits.has(_currentPage)) {
        _manualSplits.set(_currentPage, []);
    }
    _manualSplits.get(_currentPage).push(colX);
    _redrawCanvas(); // Redraws split guide line
}
Rule of thumb: adjust Y-band tolerance when analyzing rotated or non-standard font baselines to avoid line fragmentation.

Interactive Bounding Box Keyboard Shortcuts

When inspecting region classification in analyzePanel.js, select any region bounding box and use these hotkeys to override classification:

[Hotkey Reference]
L -> Convert to LATTICE_TABLE
S -> Convert to STREAM_TABLE
P -> Convert to PARAGRAPH
H -> Convert to HEADING
B -> Convert to BOX
I -> Convert to IMAGE
D -> Convert to DIVIDER
F -> Convert to FOOTER
R -> Convert to HEADER
Delete / Backspace -> Mark region as skipped (fall-through extraction)

Re-extracting Page with Custom Regions

Clicking Re-extract page posts custom regions and overrides to the background Web Worker:

// Re-extracting with manual overrides
worker.postMessage({
    type: 'reprocess',
    pageIndex: _currentPage,
    customRegions: _customRegionsByPage.get(_currentPage + 1),
    manualSplits: _manualSplits.get(_currentPage),
    scaleOverrides: _scaleOverrides
});

Conclusion

Combining spatial geometry histograms with manual region override hotkeys guarantees 100% extraction accuracy across complex multi-column PDFs.

PDF Extractor — Pull text, tables, and vector geometry out of PDFs — in the browser, with no upload.