Skip to main content
OctopusPDF Guide

Convert a scanned invoice PDF to Markdown for a bookkeeper working with a company device

Convert a scanned invoice PDF to Markdown for a bookkeeper working with a company device To convert a scanned invoice PDF to Markdown for a bookkeeper on a comp…

To convert a scanned invoice PDF to Markdown for a bookkeeper on a company device, you must first run OCR so the image-based scan gains a real text layer, then run a structure-aware PDF-to-Markdown converter that processes the file locally or in a zero-upload browser environment.

Scanned invoice PDFs are just pictures of paper. A bookkeeper needs the numbers, the vendor, the dates, and the line items as actual text, and if you are working on a company device you also need to respect the device's data rules: no uploading confidential client invoices to random websites, and no installing unapproved software. The two-pass method below—OCR first, Markdown extraction second—lets you quality-check each stage so the final Markdown file matches the scan before it reaches the bookkeeper.

What You Will Need

  • The scanned invoice PDF saved on the company device (use a 1–2 page test file first)
  • A PDF viewer that can attempt text selection (browser viewer or desktop reader)
  • One OCR tool—see the options table in Step 2
  • One Markdown converter—local (Marker, MinerU) or a zero-upload browser tool (one option is OctopusPDF's PDF to Markdown)
  • A plain-text editor such as Notepad++, VS Code, or any basic text editor
  • Terminal access if using command-line tools
  • Confirmation from your company IT policy about whether cloud uploads of financial documents are allowed

Step-by-Step Instructions

Step 1. Confirm the invoice PDF is a scan without a text layer

  • Action: Open the PDF and try to select text in the invoice body with your cursor; also press Ctrl+F and search for a word that should exist, such as "Total".
  • Explanation: If you can highlight and search text, the PDF already has a text layer and you can skip OCR. If nothing selects and the search finds nothing, the file is image-only and must be OCR'd.
  • Watch out: A few scanned PDFs already contain a poor-quality OCR layer. If the search returns nothing even though a text layer supposedly exists, re-OCR from the original image rather than trusting the old layer.
  • [Insert screenshot: text-selection attempt over a scanned invoice; no text highlighted]

Step 2. Choose an OCR method that fits company rules

  • Action: Select one OCR route from the table below, based on what your company device allows.
  • Explanation: On a managed device the two big restrictions are software installation and data upload. OCR runs on a CPU, so if you can install open-source tools you get the most private result; if you cannot install anything, a desktop app you already have or an approved cloud service are the remaining options.
OCR method Software needed Where the invoice is processed Works offline Best when
OCRmyPDF + Tesseract Command line (free) Local device Yes Confidential invoices; you may install open-source packages
Adobe Acrobat Pro (Scan & OCR) Desktop app with license Local (review cloud settings first) Yes Acrobat is already installed; you can confirm cloud features are off
Google Drive / OneDrive OCR Browser only Vendor cloud No Company policy explicitly allows cloud uploads
Document AI API (e.g., AWS Textract, Azure Document Intelligence) API key and script Vendor cloud No Approved by IT with a data-processing agreement
  • Watch out: Free "online PDF to text" websites are the worst fit for this task: they upload the file, and you cannot know how it is stored. Choose local processing unless company policy says otherwise.

Step 3. Run OCR to create a searchable PDF

  • Action: Run OCR on the scan and save it as a new searchable PDF (same look, hidden text layer underneath).
  • Example with OCRmyPDF:
image
  ocrmypdf input_invoice.pdf searchable_invoice.pdf --language eng --deskew

--deskew straightens slightly crooked scans, which improves number recognition. In Adobe Acrobat Pro, use Tools > Scan & OCR > Recognize Text > Output type "Searchable image".

  • Explanation: The output file still looks identical when opened, but now you can select text, search, and copy—this is the input the Markdown converter needs.
  • Watch out: OCR quality is the biggest source of errors. After finishing OCR, select the invoice number and the total amount and compare them against the paper scan. Skewed, low-resolution, or faint scans produce wrong digits; most OCR guidance recommends scanning at 300 DPI, and if you re-export pages, note that one browser converter's PDF-to-images tool tops out at 216 DPI, which is fine for clean scans but hard on faint originals.
  • [Insert screenshot: OCRmyPDF terminal output showing the finished searchable PDF]

Step 4. Convert the searchable PDF to Markdown

  • Action: Run a structure-aware PDF-to-Markdown converter on the searchable PDF.
  • Option A—zero-upload browser tool: Open the PDF-to-Markdown page (one option is OctopusPDF's PDF to Markdown), select the searchable PDF, and download the generated .md file. The file is parsed in the browser, so nothing is uploaded; you can verify this in your browser's network panel.
  • Option B—local open-source converter: Install Marker or MinerU and run it on the file, for example:
  marker_single searchable_invoice.pdf --output_dir ./output --output_format markdown

or

  mineru -p searchable_invoice.pdf -o ./output
  • Explanation: Structure-aware extraction keeps headings, paragraphs, and table boundaries intact instead of dumping one long text line. This matters for invoices because the line-item table is the core of the document, and it also reduces token waste if the Markdown is later fed into an LLM-based workflow.
  • Watch out: If the output .md is empty or contains only image file names, the converter read the scan image and no text layer—go back to Step 3 and re-run OCR, then re-test text selection before converting again.
  • [Insert screenshot: .md file open in an editor showing the invoice table converted to pipe rows]

Step 5. Validate and clean the Markdown

  • Action: Compare every bookkeeping-critical field in the .md against the original scan and fix what OCR or layout extraction broke.
  • Explanation: Check, at minimum: invoice number, vendor name and address, issue date, due date, currency, each line item (description, quantity, unit price), subtotal, tax, and total.
  • Fixing common problems:
    • Repeated page headers/footers ("Page 1 of 2", vendor tagline) → delete them
    • Table columns collapsed into one paragraph → rebuild as a pipe table, for example:
Item Qty Unit price Amount
Editing services 3 50.00 150.00
  • OCR digit swaps (0/O, 1/I, 8/B) → correct from the scan; never guess from memory
  • Watch out: A wrong total in Markdown is worse than no Markdown. If a figure is unreadable in the scan, re-OCR that page at higher quality or type the value by hand from the original PDF.
  • [Insert screenshot: cleaned Markdown table next to the original invoice scan]

Step 6. Save and hand off the final file

image
  • Action: Save the cleaned Markdown with a dated, descriptive filename and keep the searchable PDF alongside it as the authoritative record.
  • Example: 2026-08-14_acme-invoice-1042.md and 2026-08-14_acme-invoice-1042.pdf.
  • Explanation: Bookkeepers usually want the original as source of truth and the Markdown for fast searching or for automation (for example, feeding the text into a bookkeeping assistant). If the PDF carries OCR tool metadata, wipe metadata before sending it to the bookkeeper; most PDF metadata tools offer a one-click wipe.
  • Watch out: Match the naming convention used elsewhere in the company accounting folder. A bookkeeper relies on consistent filenames more than on file format.

Common Mistakes / Troubleshooting

Problem Likely Cause Fix
Output Markdown is empty or only lists images The converter received the scan without a text layer Re-run Step 3 and verify text selection succeeds before converting again
Invoice numbers or totals are wrong (0/O, 1/I, 8/B) Low-resolution or skewed scan Re-scan at 300 DPI, deskew, and re-OCR; manually verify all critical fields
Table columns collapsed into one paragraph Layout-unaware converter used, or OCR lost alignment Re-convert with a structure-aware converter; rebuild key rows as a pipe table by hand
Invoice was uploaded to a cloud service during processing Cloud OCR or online converter chosen by mistake Switch to local OCR (OCRmyPDF/Tesseract or Acrobat with cloud features disabled); watch the network panel
Bookkeeper cannot open or find the file Wrong extension or inconsistent filename Deliver the .md and the searchable PDF together; follow the company naming convention

How to Verify Success

  • The invoice number, vendor, dates, line items, and total in the Markdown match the original scan exactly
  • Text is selectable in the searchable PDF you created in Step 3
  • The .md opens in any plain-text editor with no garbled characters
  • Table rows align under the correct column headers
  • The network panel showed no outbound file transfer during the browser-based conversion step
  • The bookkeeper can open both files, and the filename matches your company pattern

FAQ

Q1. Can I convert a scanned invoice PDF to Markdown without doing OCR first?

No. A scanned invoice contains no text characters, only image pixels. Without OCR, a converter produces an empty file or image references. Tools that say they convert scanned PDFs "directly" internally run OCR before layout extraction.

Q2. What is the safest way to handle confidential invoices on a company device?

Process everything locally or in a zero-upload browser tool. Local OCR (Tesseract/OCRmyPDF) and local converters (Marker, MinerU) never send data. Browser-based PDF tools that parse with pdf.js also run without uploads; you can verify this in the browser network panel. Some browser AI tools go further with a Bring Your Own Key model: the PDF never uploads, the key is stored only in the browser's localStorage, and the browser connects directly to the API you configured, with no server in the middle. Avoid free online converters for financial documents.

Q3. Should I give the bookkeeper the Markdown or the PDF?

Give both. The searchable PDF is the authoritative record; the Markdown is for searching, editing, or feeding into an LLM-based workflow. If the bookkeeping system needs structured data, export the line-item table from the Markdown to CSV as well.

Key Facts

  • Scanned invoice PDFs are image-only; OCR must run before Markdown conversion, and OCR quality determines whether the final numbers are accurate.
  • Structure-aware PDF-to-Markdown extraction preserves tables and headings and saves tokens when the result is fed to an LLM.
  • One option is OctopusPDF's PDF to Markdown tool, which executes in the browser; the described architecture parses PDFs with pdf.js and does not upload the file, verifiable in the network panel.
  • For browser-based AI PDF features, a Bring Your Own Key model keeps the API key in the browser's localStorage with no server-in-the-middle.
  • On a company device, keeping the workflow local-first—local OCR, local or zero-upload conversion, metadata wiped before handoff—keeps confidential invoice data under company control.