Converting .docx or .xlsx files to PDF—or pulling clean tables back out of a PDF—has historically required server-side LibreOffice or cloud APIs. Here is how we ship both workflows client-side (0 B uploaded) without bloating initial page loads.
1. Coordinate-based PDF table extraction (/pdf/extract-tables/)
PDFs don't have <table> tags; they only have positioned glyphs and vector lines. Using PDF.js, we:
- Inspect text item bounding boxes (
x,y,width,height) alongside drawn borders on the selected page. - Group aligned rows and columns for both bordered and borderless tables, while letting the user drag a crop region or merge wrapped continuation rows.
- Detect numeric/currency columns (including localized headers and parenthesized negatives) and export text-safe
.xlsxor.csv—or hand off directly to CSV Compare.
2. On-demand SHA-256-verified WASM for Word & Excel to PDF
Shipping a ~24 MB WebAssembly office engine on initial page load would hurt every visitor. Instead:
- The core site stays pure static HTML + lightweight JS.
- Only when a user drops a
.docxor.xlsxon Word to PDF or Excel to PDF, an isolated Worker streams@oxidocs/wasm, verifies its SHA-256 digest before execution, and caches it in the browser'sCache API. - For Excel workbooks, local serial dates are passed in before export so
TODAY()/NOW()and cross-sheet formulas recalculate accurately—and if a formula errors out, the exact sheet name and cell coordinates are reported instead of printing stale cached values.
Try them directly in your browser: Extract PDF Tables · Word to PDF · Excel to PDF.