Language: EN


How to print PDFs in C# with PDFtoPrinter .NET

PDFtoPrinter .NET is a library for .NET that allows us to easily print a PDF from a C# application.

To do this, it uses PDFtoPrinter, a command-line tool that allows you to print PDF files on a default printer. Internally, it uses a free version of Tracker Software Products :: PDF-XChange Editor.

Using PDFtoPrinter from C# is not too complicated. But we can make it even easier thanks to the wrapper for NET.

PDFtoPrinter .NET adds the console application as a resource to the application, so we don’t have to download and include it as a resource. We simply add the Nuget package and we are ready to go.

It is a very simple library that lacks options to customize printing, such as choosing paper format or orientation.

However, if you simply need to print a PDF from a C# application, it is possibly the easiest and fastest way to add this functionality to your project.

How to use PDFtoPrinter

We can easily add the library to a .NET project through the corresponding Nuget package.

Install-Package PDFtoPrinter

Then, printing a file is as simple as doing.

var filePath = "c:\path\to\pdf\file.pdf";
var networkPrinterName = "\\myprintserver\printer1";
var printTimeout = new TimeSpan(0, 30, 0);
var printer = new PDFtoPrinterPrinter();
printer.Print(new PrintingOptions(networkPrinterName, filePath), printTimeout);

PDFtoPrinter is Open Source, and all the code and documentation is available in the project’s repository at