Skip to content
PreviewFix
Data conversion, pricing & spare parts7 min readReviewed

Turning supplier PDFs into penny-exact import files.

How multi-page PDF table geometry, multilingual column header normalisation and integer minor-unit arithmetic work together so wholesale catalogues and supplier bills import cleanly into Shopify, WooCommerce, Xero and NetSuite.

  • Integer minor units
  • UTF-8 CSV
  • Shopify / WooCommerce
  • Xero Bills

Key engineering takeaways

Summary
  • Never represent currency as IEEE-754 floating-point numbers during conversion; parse strings directly into integer minor units (pence or cents).
  • Reconcile every payable row deterministically (quantity × unitAmount + tax === lineTotal) and flag discrepancies instead of smoothing them over.
  • Stitch repeated table headers across PDF page breaks before mapping columns so continuation rows do not lose their category or pack-size context.
  • Keep catalogue import files UTF-8 encoded without locale decimal commas (12.50, not 12,50) while preserving leading zeros in EAN/GTIN barcodes.

Published by MeWeBe Limited · Factual engineering reference

1. Why copy-paste and naive OCR corrupt trade PDFs

PDF is a page-layout coordinate format rather than a tabular data format. A wholesale line sheet or multi-page trade invoice stores glyph runs at (x, y) coordinates with no native row or column elements. When a supplier exports a catalogue with merged category banners, two-line descriptions, pack-of-six pricing and repeated page headers, standard text selection scrambles column alignment.

Feeding raw text into an unconstrained language model introduces a worse failure mode: silent digit substitution or rounded totals that look plausible at a glance. A reliable B2B conversion pipeline separates layout reconstruction from deterministic schema and arithmetic verification so every extracted cell either reconciles to the penny or is explicitly flagged for human review.

  • Page-break continuation stitching: Repeated running headers, footer page numbers and subtotal carry-forwards are stripped before table rows are merged into one logical dataset.
  • Pack-quantity disambiguation: Columns such as MOQ, Case Qty (VE 6, Colis de 12) and unit trade cost are separated so a case price is not accidentally imported as a single-unit retail price.
  • Barcode string preservation: 8-, 12-, 13- and 14-digit GTIN/EAN/UPC strings are typed as strings from the start so spreadsheet tools never strip leading zeros or format barcodes in scientific notation.

2. Multilingual column header normalisation

European and UK trade suppliers rarely use English-only column labels that match Shopify or Xero import templates verbatim. A deterministic synonym dictionary paired with column-value pattern checks maps supplier headers into canonical fields (sku, title, ean, packQty, unitCostMinor, rrpMinor, taxRateBps, lineTotalMinor) before target templates are emitted.

Locale number parsing runs alongside header detection. Continental European price lists routinely use a period or narrow space as the thousands separator and a comma as the decimal separator (1.249,50 €), whereas UK and US documents invert that convention (£1,249.50). Detecting the document locale first prevents thousand-fold price errors.

Canonical row model vs Shopify & Xero CSV columnsSpecimen
// Canonical extracted row (integer minor units, never floats)
{
  "sku": "VLV-22-BR",
  "ean": "05060012345678",
  "description": "22mm Brass Isolation Valve (Pack of 10)",
  "quantity": 4,
  "unitAmountMinor": 1850,   // £18.50
  "taxAmountMinor": 1480,    // £14.80 (20% UK VAT on £74.00 net)
  "grossTotalMinor": 8880    // £88.80 -> 4 * 1850 + 1480 === 8880 (PASS)
}

// Emitted Xero purchase bill row:
// *ContactName,*InvoiceNumber,*InvoiceDate,*DueDate,ItemCode,Description,*Quantity,*UnitAmount,*AccountCode,*TaxType
// " Northgate Brass Ltd","INV-88412","2026-11-18","2026-12-18","VLV-22-BR","22mm Brass Isolation Valve (Pack of 10)",4,18.50,"310","20% (VAT on Expenses)"

3. Penny-exact validation in integer minor units

Binary floating-point arithmetic cannot represent base-10 decimals such as 0.10 or 19.99 exactly (41.25 * 12 or multi-rate tax splits routinely accumulate sub-penny drift). In @repo/pipeline-kit and our pdf.convert engine operation, decimal strings are parsed straight into integer minor units (Money.amountMinor) via regex digit extraction (moneyFromMajor), never parseFloat.

Once every row is represented as integers, two classes of deterministic invariants run across the whole file before any CSV is written:

  • Payables & invoice line reconciliation: Checks quantity × unitNetMinor - discountMinor === lineNetMinor and sums line totals against the printed invoice subtotal, tax summary by rate band and grand total.
  • Catalogue margin & RRP sanity check: When a price list carries both trade buy price and recommended retail price (RRP / UVP), flags any SKU where rrpMinor < unitCostMinor or where a variant SKU appears twice with conflicting prices.
  • Non-destructive exception flagging: When a supplier's own printed PDF contains a rounding discrepancy, the converter never invents a silent correction; it marks the row in validation.issues[] and isolates it on a dedicated review tab in the XLSX workbook.

4. Pre-import checklist for Shopify, WooCommerce and Xero

Storefront and accounting importers apply strict validation rules on upload. Shopify groups multi-size or multi-colour products by shared Handle, requiring Title and Vendor on the first row of each handle group while variant rows carry Option1 Value, Variant SKU and Variant Price. WooCommerce separates Type (simple, variable, variation) and Parent SKU references. Xero requires exact matches between TaxType strings and the tax rates configured in your chart of accounts.

You can inspect how our parser handles pages 1–2 of your own PDF at /tools/pdf-to-erp (pdf.preview, 0 API units) before unlocking full conversion files or automating recurring supplier drops through POST /api/v1/engines/pdf/convert.

SPEC · PDF-ERP-01 · Reviewed 18 November 2026

Supplier header & validation matrix

Multilingual column normalisation and deterministic integer checks applied during conversion

Engineering checklist
Canonical fieldCommon supplier labelsTarget CSV columnRule
skuItem No, Art.-Nr., Réf., Código, Cod. Art.Variant SKU / SKU / ItemCodeRequired · Unique
eanBarcode, EAN-13, GTIN, UPCVariant Barcode / Meta: _global_unique_idText · Mod-10 check
unitNetMinorTrade, Net Price, EK netto, Prix HT, Precio NetoCost per item / Regular price / UnitAmountInteger pence/cents
rrpMinorRRP, MSRP, UVP inkl. MwSt., PVCVariant Compare At Price / Regular priceMust >= trade cost
lineTotalMinorLine Total, Amount, Gesamtbetrag, Montant HTXLSX reconciliation control columnqty × unit === total

Before importing into a live ledger or storefront

  • Open the XLSX reconciliation tab and confirm validation.failed === 0 (or inspect flagged supplier typos).
  • Verify barcode columns remain plain digits (05060...) without spreadsheet 5.06E+12 scientific formatting.
  • Confirm whether supplier prices are net (HT / ex-VAT) or gross before setting storefront tax-inclusive flags.
  • Test a 5-row sample in a staging store or draft Xero bill batch before importing a seasonal catalogue.

Technical file conversion and arithmetic verification only — always review tax codes and account mappings before posting to live accounting ledgers.

Technical questions

Common edge cases & boundaries

What happens if a supplier PDF is a scanned image rather than selectable text?
Clean vector PDFs extract with the highest structural fidelity. High-resolution scans can still be parsed, but low-resolution fax scans or handwritten margin notes that leave digits ambiguous are flagged in validation.issues rather than guessed.
Does converting a supplier bill push data straight into Xero or Shopify?
No. Self-serve orders produce downloadable UTF-8 CSVs and an XLSX workbook so your finance or merchandising team reviews every row before running the import inside Shopify, WooCommerce or Xero.
How are European comma decimals (14,95) converted for UK/US CSV importers?
The parser detects the source locale's thousands and decimal separators across the column distribution, converts to integer minor units (1495), and formats output CSV decimals with standard ASCII periods (14.95).

Run on your own input

Paired services & previews.

Every digital deliverable starts with a free preview on your own file, URL or domain; managed services lock your quote upfront and hold supplier payout until completion proof clears.

Continue reading

Related technical guides.

7 min read

Omnibus 30-day prior price & VIES VAT

How to compute the lowest price applied during the preceding 30 days under Directive (EU) 2019/2161 (Article 6a) in integer minor units, avoid fake strikethrough RRP traps, and validate EU/NI B2B VAT numbers via VIES.

8 min read

EN 16931, Peppol, Veri*factu & KSeF

How the European semantic invoice model (EN 16931-1) maps into UBL 2.1, UN/CEFACT CII and national clearance/billing records across Peppol BIS 3.0, German XRechnung/ZUGFeRD, Spanish Veri*factu and Polish KSeF.

8 min read

BYOK vs prepaid credits: micro-API & licences

How our 25 HTTP engine endpoints separate zero-LLM deterministic checks from optional AI operations, how Bring-Your-Own-Key (BYOK) vs prepaid credits prevent surprise overage bills, and how AKL1 Ed25519 tokens verify offline.

Test before checkout

Inspect a free preview first.

Run our deterministic checks or live quote tool on your own file, URL, domain or postcode before paying a penny.