NEW IN PD4ML 4.2 · MARKDOWN OUTPUT

Give your LLM what the reader sees, with page numbers that match the PDF.

Raw HTML wastes tokens on markup and includes text no reader ever sees, and text extracted from a PDF loses the document's structure. PD4ML 4.2 writes Markdown built from the same layout as the PDF: the visible text in reading order, with headings, lists and tables intact.

Optional page markers tie every chunk to its PDF page, so an answer can cite its source and a person can check it.

Format
GitHub-flavored Markdown, UTF-8
Source
The PDF's own layout
Citations
<!– page N –> markers
Interfaces
Java, .NET, CLI, Docker
Edition
DMS and UA, v42 engine
Visible text
only, no hidden content
Reading order
with structure
Page markers
cite by page
Fewer tokens
no markup or styles
One parse
PDF and Markdown
WHY IT'S BETTER INPUT

Clean text for models, indexes and search.

Only what a reader sees

Text hidden by CSS (display: none, visibility: hidden, clipped overflow) is left out, and CSS-generated text such as list numbers and ::before content is kept.

v4.2v42 engine

Structure intact

Headings, nested lists, tables, emphasis, links, code, footnotes and image references, in reading order.

v4.2v42 engine

Page markers for citations

Each page can start with <!-- page N -->, where N is the page of the PDF from the same conversion, so a chunk can be cited by page.

v4.2v42 engine

Compact

No layout markup, scripts or styles: the same content in far fewer tokens than the HTML.

v4.2v42 engine

PDF and Markdown together

Store the PDF for people and index the Markdown for machines, from one readHTML() and with matching page numbers.

v4.2v42 engine

E-mail and web archives too

.eml messages and .mht/.mhtml files are read like HTML, so mailboxes and saved pages can feed the same pipeline.

v4.2DMS · UA
JAVA, .NET, CLI OR DOCKER

One call in your pipeline.

The page size and HTML width decide where pages break, exactly as for the PDF, so the page markers match it.

From the command line it is -outformat markdown -pagemarkers, and the Docker service takes format=markdown.

PD4ML pd4ml = new PD4ML();
pd4ml.useHtmlRenderer(Constants.LayoutEngine.v42);
pd4ml.readHTML(new URL("https://example.com/report.html"));

pd4ml.writePDF(new FileOutputStream("report.pdf"));     // for people
try (OutputStream md = new FileOutputStream("report.md")) {
    pd4ml.writeMarkdown(md, true);   // <!-- page N --> markers
}

# or as a service:
# curl -X POST --data-binary @report.html \
#   "http://localhost:8080/convert?format=markdown&pagemarkers=true"
USE CASES

Where teams use it.

  • RAG over generated documents: index the statements, contracts and reports your system already produces, and cite answers by PDF page.
  • Knowledge bases and search: turn intranet pages, help centers and e-mail archives into clean chunks.
  • LLM summaries: send the model the text a reader sees, without navigation, cookie banners or hidden markup.
  • Audit trails: keep the PDF as the record and the Markdown as its machine-readable twin.

Features marked v4.2 are part of the PD4ML v4.2.0 development snapshot: download it from the Downloads page or use 4.2.0-SNAPSHOT from the Maven repository. The other features are in the current releases, PD4ML v4.1.2 and v4.0.24. The release notes and What Is New in PD4ML v4.2.0 list every change.

MORE IN PD4ML 4.1 AND 4.2

Explore the other improvements

Turn your documents into clean Markdown.

Download PD4ML 4.2, request a free evaluation license and feed one of your documents to your pipeline.