EvoPdf Next · PDF to Markdown

Convert PDF documents to Markdown from .NET

The PDF to Markdown Converter writes the content of a PDF document as Markdown text: headings, lists, tables, code and links are found from the layout of the pages, so the document does not have to be tagged. The images can be embedded in the text or saved as files. Password-protected documents and page ranges are supported. The library targets .NET Standard 2.0 and runs on Windows, Linux and macOS, including Azure App Service, Azure Functions and Docker.

Version 15.1.0. Building EVO PDF libraries since 2010. Evaluate without registration; the demo output is watermarked until you set a license key. Licensed as part of the EVO PDF Toolkit.

Documentation · Samples and demos on GitHub · AI agent skills

ConsoleCLI
dotnet add package EvoPdf.Next.PdfProcessor.Windows

This is the Windows package; EvoPdf.Next.PdfProcessor.Linux and EvoPdf.Next.PdfProcessor.MacOS work the same way, or use the all-components EvoPdf.Next.* metapackage for your platform. This component ships in the PDF Processor package.

Program.csC#
using EvoPdf.Next;

var converter = new PdfToMarkdownConverter();

// the whole document
string markdown = converter.ConvertToMarkdown(pdfBytes);
File.WriteAllText("document.md", markdown);

// or only the pages 2 to 5
string chapter = converter.ConvertToMarkdown(
    pdfBytes, 2, 5);
Convert a document or a range of its pages. Full sample in the docs →
  • Windows 10, 11 and Windows Server 2016 to 2025 (x64 and ARM64)
  • Linux 64-bit distributions (x64 and ARM64)
  • macOS 12.0+ (Apple Silicon / ARM64)
  • .NET 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, .NET Standard 2.0
  • .NET Framework 4.6.2 to 4.8.1
  • Azure App Service, Functions and Container Apps
  • AWS Elastic Beanstalk, Lambda and ECS
  • Google Cloud Run and Kubernetes
  • Web, console and desktop applications
Images

Keep the images of the document with the text

The images are left out by default, which keeps the Markdown small. Set ImageMode to embed them in the text or to save them as PNG files in a folder, with links from the Markdown. Each image is placed where it is on the page, between the paragraphs around it. An image drawn on several pages is written once.

For tagged documents, such as PDF/UA files, the TaggedPdfToMarkdownConverter class follows the structure marked by the tags of the document. It is part of the Core PDF API component. Convert Tagged PDF to Markdown: documentation →

Images.csC#
using EvoPdf.Next;

var converter = new PdfToMarkdownConverter();

// save the images next to the Markdown file
converter.ImageMode = PdfToMarkdownImageMode.File;
converter.ImagesFolder = "output/report_images";

string markdown = converter.ConvertToMarkdown(
    "report.pdf");
File.WriteAllText("output/report.md", markdown);
Features

What the PDF to Markdown component does

  • Convert PDF documents from memory, stream or file to Markdown
  • Headings with their levels, taken from the bookmarks when the document has them
  • Bulleted and numbered lists, code blocks, bold and italic text
  • Tables found from the ruling lines and from the alignment of the text
  • Tables that continue on the next pages written as one table
  • Links of the document written as Markdown links
  • Images embedded in the text or saved as PNG files
  • Repeated page headers and footers left out
  • Password-protected PDF documents and page ranges
  • Asynchronous methods that can be used with async and await

NuGet packages

Reference EvoPdf.Next.PdfProcessor.Windows, .Linux, .MacOS or the .Arm64 variants, or the EvoPdf.Next.* metapackage for your platform, which includes every component.

ConsoleCLI
dotnet add package EvoPdf.Next.PdfProcessor.Windows

On nuget.org: EvoPdf.Next.PdfProcessor.Windows · .Linux · .MacOS · .Windows.Arm64 · .Linux.Arm64 · metapackage EvoPdf.Next

PDF to Markdown is distributed as part of the EvoPdf Next PDF Processor (EvoPdf.Next.PdfProcessor packages), together with PDF to Text, PDF to Image and PDF Images Extractor.
PDF to MarkdownDemoDocs + code
Tagged PDF to MarkdownDemoDocs + code
Licensing

Included in the EVO PDF Toolkit

PDF to Markdown is licensed as part of the EVO PDF Toolkit, which covers every component on this site, Next and Classic: 650 USD for a Deployment License (one application on a single server) or 1400 USD for a Company License (unlimited developers, applications and servers, redistributable). Perpetual, with updates and support for the first year.