PL/PDF2MD — PDF to Markdown Conversion for Oracle PL/SQL
Convert text-based PDF documents into readable, structured Markdown directly in Oracle Database—with headings, lists, tables and form data reconstructed from PDF text and page geometry.
PL/PDF2MD is a deterministic PL/SQL converter. Process PDF BLOBs inside your Oracle application without AI, OCR, an external conversion API or a separate document-processing service.
From PDF text to usable Markdown
PDF files describe positioned text and graphics, not necessarily the logical reading order. PL/PDF2MD combines text extraction, font information and page coordinates to produce Markdown that preserves useful document structure where the source PDF allows it.
Headings, emphasis and lists
Recognize document titles, section headings, bold and italic text, numbered items and bullet lists. Produce Markdown that is easier to navigate than a single block of extracted text.
Tables and form data
Reconstruct grid-based and aligned tables, financial line items, invoice columns and key-value pairs. Keep related labels and values together when their geometry provides sufficient evidence.
Columns and code examples
Apply geometry-aware reading order to supported multi-column layouts and panels. Recognize selected monospaced SQL and XML examples as fenced Markdown code blocks.
One PL/SQL function, two output profiles
The public API accepts a PDF BLOB and returns a Markdown CLOB. Choose STRUCTURED (the default) for document formatting, or TEXT for readable text with paragraph breaks only.
-- Assume l_source_pdf is a BLOB supplied by your application.
-- Reconstruct headings, lists, emphasis, tables and columns.
l_markdown := pl_pdf2md.convert(
p_pdf => l_source_pdf,
p_profile => 'STRUCTURED'
);
-- Readable text and paragraphs without Markdown structure.
l_plain_text := pl_pdf2md.convert(
p_pdf => l_source_pdf,
p_profile => 'TEXT'
);
The input PDF is not modified. The returned value is a temporary CLOB owned by the caller: store or consume it in your application, then release it using DBMS_LOB.FREETEMPORARY. The converter does not write files to the server filesystem.
Example: convert a PDF payment statement into a Markdown table
The following excerpt illustrates structured output from a tested PDF payment reminder. Its original financial table is reconstructed as Markdown rows, including the amounts and accompanying notes.
## Mahnung
| Position | Betrag CHF | Note |
| --- | --- | --- |
| Grundforderung | 18.75 | Zuzüglich Verzugszins 5.00% seit 06.11.2026 |
| Mahngebühren | 76.00 | |
| Umtriebsgebühren | 15.00 | |
| Verzugszins bis 05.11.2026 | 0.35 | |
| Gesamtforderung | 110.10 | Valuta 05.11.2026 |
This is a text-and-structure conversion, not a recreation of the original PDF page. The Markdown can be saved in an Oracle CLOB column, shown in an application, indexed for search or passed to a downstream workflow.
How PL/PDF2MD reconstructs document structure
A predictable conversion pipeline reads the PDF content and uses the available position and styling information to identify structural relationships. It does not ask a language model to interpret or rewrite the document.
Text and font analysis
Extract available Unicode text, character positions, font sizes and emphasis. Use typographic differences to recognize headings and inline formatting.
Layout and table detection
Inspect text alignment, columns, baselines and available drawn rules or rectangles to identify tables, rows, cell boundaries and paired fields.
Reading order and filtering
Group supported page regions and payment panels in a usable order. Exclude invisible PDF text and certain nonprinting metadata from the structured output.
Built for Oracle application workflows
BLOB in, CLOB out
Call a single PL/SQL function with a PDF already stored in Oracle. Receive Markdown as a CLOB for storage, display, indexing or export.
APEX, ORDS and jobs
Use the converter from stored PL/SQL, Oracle APEX applications, ORDS handlers and scheduled database processing without moving the PDF to an external converter.
Deterministic processing
No AI model, network call or OCR engine is involved in conversion. Repeated processing follows the same layout rules and does not generate new textual content.
Supported scope and important considerations
Supported conversion: Text-based PDFs with reliably decodable text; Markdown headings, paragraphs, bold and italic emphasis, bullet and numbered lists, supported tables, aligned key-value fields, selected multi-column regions and recognized SQL/XML code blocks. The TEXT profile provides reading-order text with paragraph breaks.
No OCR or image extraction: Scanned, image-only PDFs cannot be converted without a separate OCR step. Embedded photos, signatures, logos and QR-code images are not exported as Markdown image assets. PL/PDF2MD does not decode QR codes.
Layout limitations: Complex nested tables, unusual fonts, arbitrary overlapping text, advanced multi-column designs and incomplete Unicode mappings may prevent faithful reconstruction. The converter cannot guarantee the original reading order or visual layout for every PDF. When source text cannot be decoded reliably, conversion can return an error rather than silently inventing content.
Independent output: Markdown is a text representation, not a visually identical PDF replica. Review critical financial, legal or administrative documents before relying on reconstructed field relationships in automated decisions.
Try PL/PDF2MD
Bring PDF-to-Markdown conversion into your Oracle workflows. Request an evaluation of PL/PDF2MD in your own database or ask about testing it in the hosted PL/ sandbox.
