EvoPdf Next · PDF to Text

Extract and search text in PDF documents from .NET

The PDF to Text Converter extracts text from PDF documents in the original layout or optimized for reading and searches text in PDFs returning the exact position of every match, including in password-protected documents and page ranges. The library targets .NET Standard 2.0 and runs on Windows, Linux and macOS, including Azure App Service, Azure Functions and Docker.

Version 14.86.1. 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 PdfToTextConverter();
converter.TextLayout = PdfToTextLayout.Original;
string text = converter.ConvertToText(pdfBytes);

// search text; each match has page and position
var matches = converter.FindText(pdfBytes,
    "invoice", caseSensitive: false,
    wholeWord: true);
foreach (var m in matches)
    Console.WriteLine($"{m.PageNumber}: {m.X},{m.Y}");
Extract text with the original layout. 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 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
Text search

Find text and get its exact position on the page

The same converter searches a PDF for a string and returns every match as a FindTextLocation: the page number and the bounding box of the text in PDF points. Case-sensitive and whole-word matching are options; the search can cover the whole document or a page range, including password-protected files.

Typical uses: locating where to stamp or highlight, validating generated documents, or building an index. Search for text in PDF: documentation →

FindText.csC#
using EvoPdf.Next;

var converter = new PdfToTextConverter();

// case-sensitive: false, whole word: true
FindTextLocation[] hits = converter.FindText(
    pdfBytes, "invoice", false, true);

foreach (var hit in hits)
    Console.WriteLine(
        $"page {hit.PageNumber}: {hit.X},{hit.Y} " +
        $"{hit.Width}x{hit.Height}");
Features

What the PDF to Text component does

  • Convert PDF documents from memory, stream or file to text
  • Search text in PDF documents, returning text positions
  • Convert or search password-protected PDF documents
  • Convert or search the entire PDF or a range of PDF pages
  • Extract text with the original layout or optimized for reading
  • Search text with a case-sensitive option
  • Search text with a whole-word option
  • Asynchronous methods that can be used with async and await
  • Docker containers for Windows and Linux

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 Text is distributed as part of the EvoPdf Next PDF Processor (EvoPdf.Next.PdfProcessor packages), together with PDF to Image and PDF Images Extractor.
PDF to TextDemoDocs + code
Find and highlight text in PDFDemoDocs + code
Licensing

Included in the EVO PDF Toolkit

PDF to Text 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.