Installation
NuGet package
.csproj:
Dependencies
PDF4LLM depends on MuPDF.NET and lists it as a NuGet dependency. It is installed automatically — you do not need to add MuPDF.NET separately. After installation, two native DLLs are required at runtime:
The NuGet package copies these to your project’s output directory on build. If your deployment environment does not allow automatic DLL placement, both files must be present in the same directory as your application executable, or on a path accessible via the
PATH environment variable.
Supported targets
PDF4LLM targets .NET Standard 2.0, making it compatible with any framework that implements that standard.
Verify the installation
Add ausing directive and call ToMarkdown on any PDF to confirm everything is wired up:
Resolving the assembly conflict
If you see this error at build or runtime:PDF4LLM package reference and rely on the bundled version:
.csproj manually:
using PDF4LLM; and PdfExtractor.* work regardless of which package supplies the assembly.
A future release of MuPDF.NET will stop bundling PDF4LLM, allowing both packages to coexist without conflict. Until then, use one or the other.
Optional: OCR support
OCR is not required for most PDFs. Enable it only when working with scanned documents or pages that contain no selectable text. OCR requires Tesseract to be installed on the host system and available on thePATH. PDF4LLM does not bundle Tesseract.
Windows — Download the installer from UB Mannheim Tesseract builds and add the install directory to your PATH.
macOS