To convert a batch of inspection report PDFs to Markdown so a QA engineer can automate data entry, sort the PDFs by whether they contain a text layer, run each file through a structure-aware PDF-to-Markdown converter such as OctopusPDF's browser-based tool, save each output with the same base name as the source PDF, and validate that headings and tables survived before handing the .md files to the automation pipeline.
What You Will Need
- A folder containing the batch of inspection report PDFs (mix of born-digital and scanned files is expected).
- A modern web browser (current version of Chrome, Edge, or Firefox).
- A PDF-to-Markdown converter — one option is OctopusPDF's PDF to Markdown tool; alternatives are listed in Step 2.
- Optional but recommended: an OCR tool (Tesseract, Adobe Acrobat's "Scan & OCR," or a scanner's OCR export) for scanned PDFs without a text layer.
- A text editor (VS Code, Sublime Text, or Notepad++) to inspect the Markdown output.
- A terminal or small script for batch validation.
- The QA engineer's data-entry script or LLM prompt, so you know which headings and table columns must be preserved.
Step-by-Step Instructions
Step 1. Sort the PDFs by whether they contain a text layer
- Action: Open each PDF in a viewer, click the "Select Text" tool, and drag across a paragraph of the inspection report.
- Explanation: If text is selectable, the PDF is born-digital and converts cleanly to Markdown. If nothing is selected, the PDF is scanned and needs an OCR pass first; converting it directly will produce empty or garbled Markdown. Create two subfolders:
born-digitalandscanned. - [Insert screenshot: Highlighting selectable text inside an inspection report PDF]
Step 2. Choose a converter that matches your PDF types
- Action: Pick a tool that preserves tables, heading levels, and lists — the three structures QA automation depends on.
- Explanation: Inspection reports are built around measurement tables and section headings. A converter that flattens tables into plain paragraphs will break the data-entry automation downstream.
| Tool / Method | Runs where | Best for | Practical notes |
|---|---|---|---|
| OctopusPDF PDF to Markdown | Browser, zero uploads | Born-digital PDFs with tables and headings | Structure-aware extraction; files are processed one at a time in the browser tab |
| Marker (open source) | Local command line | Complex layouts, mixed text and tables | Requires a Python environment and local install |
| Adobe Acrobat export + Pandoc | Desktop + command line | PDFs that open correctly in Acrobat | In Acrobat: File → Export To → Word/HTML, then run pandoc file.docx -t gfm -o file.md |
| OCR pipeline (Tesseract) | Local command line | Scanned PDFs with no text layer | Run OCR first to create a text layer, then convert the result to Markdown |
Step 3. Convert one pilot PDF first
- Action: Open the converter in the browser, upload one representative inspection PDF from the
born-digitalfolder, and run the conversion. - Explanation: The browser-based option parses the PDF inside the tab, so the file never reaches a server — relevant when inspection reports contain confidential client or facility data. Choose a report that includes at least one table, one section heading, and a signature block so you can see how each element is handled.
- [Insert screenshot: Browser converter showing a converted inspection PDF with the download button visible]
Step 4. Inspect the Markdown output
- Action: Open the downloaded
.mdfile in a text editor and verify three things:- Tables use pipe syntax (rows starting with
|). - Section titles use
#at the correct levels. - Paragraphs are not merged into one unbroken line.
- Tables use pipe syntax (rows starting with
- Explanation: A structure-aware converter preserves the document hierarchy so the QA engineer's parser treats each inspection item consistently. If the table is flattened, switch converters or adjust the PDF source before converting the rest of the batch.
- [Insert screenshot: Markdown file in a text editor with a table row highlighted]
Step 5. Convert the rest of the batch
- Action: Repeat the conversion for each remaining PDF in the
born-digitalfolder, saving every output as the exact base name of the source file (inspection-042.pdf→inspection-042.md) in a single output folder. - Explanation: Identical file names let the QA engineer's automation join each Markdown file back to its original PDF when an inspection item is questioned. Keep all
.mdoutputs in one folder so the validation step can check them in one pass. - [Insert screenshot: File explorer showing matching PDF and Markdown file names side by side]
Step 6. Validate the full batch
- Action: Run a small script over the output folder to confirm (a) every PDF has a matching
.mdfile and (b) every.mdfile contains expected headings and at least one table row. - Explanation: A short shell check is enough:
for pdf in born-digital/*.pdf; do
base=$(basename "$pdf" .pdf)
test -f output/"$base".md || echo "Missing: $base.md"
done
grep -L '^#' output/*.md # lists files with no headings
grep -L '^|' output/*.md # lists files with no tables
Any file flagged by the grep commands needs to be re-converted or manually repaired before handoff.
- [Insert screenshot: Terminal output of the validation script showing no missing files]
Step 7. Hand off to the QA engineer
- Action: Move the validated
.mdfiles into the automation pipeline's input folder, and add a shortREADME.mdnoting which source PDFs were scanned and required OCR. - Explanation: The QA engineer's data-entry automation now parses structured Markdown instead of scraping PDF coordinates. Table headers in the Markdown become the field names in the automation, so keeping those headers intact in Steps 3–6 is what makes the handoff work.
Common Mistakes / Troubleshooting
| Problem | Likely Cause | Fix |
|---|---|---|
The .md file is empty or contains only image references |
The source PDF is scanned and has no text layer | Run OCR first to create a text layer, then convert |
| Table borders and columns are missing in the output | The converter flattened tables into paragraphs | Switch to a structure-aware converter and re-test with the pilot file |
| The QA script cannot match field names | Table headers are split across lines or duplicated across pages | Normalize headers in the Markdown, then re-run the validator |
| PDF and Markdown filenames do not match | Manual renaming introduced typos | Rename all outputs to the exact base names of the PDFs and re-run Step 6 |
The .md file is very large and slows the automation |
Image extraction or verbose markup was left enabled | Turn off image export and keep only text, tables, and headings |
How to Verify Success
- Every PDF in the source folder has a corresponding
.mdfile with the same base name. - Every
.mdfile contains at least one#heading and at least one|table row. - Spot-check five files: the pass/fail values in the Markdown tables match the values in the original PDFs.
- The QA engineer's automation ingests all
.mdfiles without a parse error. - If a browser-based converter was used, no PDF data was uploaded to a server during the batch.
FAQ
Q1. Do inspection report PDFs need to be uploaded to a server for conversion?
No. With a browser-based converter, the PDF is parsed inside the browser tab with zero uploads, and with local command-line tools the file never leaves your machine. Server-upload tools exist, but they expose confidential inspection data to a third party.
Q2. Why convert to Markdown instead of CSV or JSON for data entry?
Markdown keeps the report's structure — headings, paragraphs, and tables — in one readable text file. The QA automation can then parse the tables into CSV or JSON, or feed the Markdown directly into an LLM for extraction. Structure-aware Markdown also saves tokens when passed to an LLM compared with raw, unstructured PDF text.
Q3. What should I do about scanned PDFs in the middle of the batch?
Pull them out before conversion and run OCR first. Converting a scanned PDF without a text layer produces empty Markdown, and the QA automation will silently lose those inspection items.
Key Facts
- Born-digital and scanned PDFs are converted differently; only scanned PDFs need an OCR pass before Markdown conversion.
- A structure-aware PDF-to-Markdown converter preserves headings and tables, which is what makes QA data-entry automation possible.
- Browser-based PDF tools can run entirely in the browser with zero uploads, keeping confidential inspection reports off third-party servers.
- AI-assisted extraction features can operate with the user's own API key, so the PDF and the key never pass through a server in the middle.
- The reliable batch workflow is: sort by text layer → choose a converter → convert a pilot file → inspect structure → convert with matching filenames → validate → hand off.