Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
Are you looking for a way to print PDF files without using Adobe Acrobat? The increased use of PDFs in the modern world means that it has become important to have a reliable and efficient solution for printing these kinds of files. Many people use Adobe Acrobat for this purpose, but it is not always available, or affordable.
In this article, we will discuss how you can print PDF documents using C# .NET applications without using Adobe Reader. For this purpose, we will use the IronPDF C# PDF library.
IronPDF is a C# PDF library that enables developers to generate, convert, and manipulate PDF documents with ease. It provides a simple API that allows developers to create and edit PDF files with just a few lines of code. With IronPDF, developers can easily add headers and footers, split and merge PDFs, and perform other common PDF operations. The library supports a wide range of file formats, including HTML, images, and Microsoft Office documents, making it easy to convert these formats to PDF. IronPDF is a powerful and flexible solution for C# developers looking to work with PDFs.
Using IronPDF, printing PDFs without a PDF reader is a piece of cake — just follow the instructions below.
Before we get to the stage of printing documents, some requirements first need to be fulfilled.
First, open Visual Studio.
A start-up window will appear — click on "Create a new project".
New Visual Studio Project
In the next window, select "Console Application" and click the Next button in the bottom right corner.
New Visual Studio Console Application
Another window will now appear — write the name of your project, select its location, and click the Next button.
Project Name
Your new C# Console Application project is now created and ready to use.
New Project Creation Finished
Once the project is created, all that is left to do before you can print PDFs without Adobe is to install the IronPDF C# library in your project.
There are many different ways to install IronPDF, but, to keep this article short, we will only be demonstrating one of them — the NuGet Package Manager.
In your newly created project, click on Tools in the menu bar and a dropdown menu will appear.
NuGet Package Manager UI
From this dropdown menu, hover your mouse over "NuGet Package Manager", and a side menu will appear. From this menu, click on "Manage NuGet Packages for solutions...".
Manage NuGet Packages for Solutions...
A new page will open where you can navigate and browse pages.
The NuGet Package Manager Window opened
In the search bar, write IronPDF, and you will see the list of IronPDF packages. Simply click on the most recent package and install it.
Browsing for NuGet Packages
It will only take a couple of minutes to install. and it will then be ready to use for printing PDF files.
To print PDF documents using C#, you can use IronPDF, a C# PDF library that supports printing. With IronPDF, you can easily print a PDF document directly from code by using the Print method. Using IronPDF, you can convert HTML files to PDF files, and print PDF documents in runtime using a single line of code. You can also print PDF documents directly from URLs.
With IronPDF, you can easily convert an HTML file to a PDF document and then print it. Here is an example of how you can print a PDF file from an HTML file in C# using IronPDF:
using IronPdf;
// Create a new PDFdocument and print it
var renderer = new IronPdf.HtmlToPdf();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Send the PDF to the default printer to print
// 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300,true);
using IronPdf;
// Create a new PDFdocument and print it
var renderer = new IronPdf.HtmlToPdf();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Send the PDF to the default printer to print
// 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300,true);
Imports IronPdf
' Create a new PDFdocument and print it
Private renderer = New IronPdf.HtmlToPdf()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
' Send the PDF to the default printer to print
' 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300,True)
The above sample code is for the silent printing of PDF documents. If you want to save the created PDF files and open them in a PDF viewer, you need to change pdf.Print(300, true)
to pdf.Print(300, false)
. This small change allows you to save the PDF files before printing.
Print Output File Location
Below is the output from printing the PDF document.
IronPDF PDF Printing
IronPDF also offers an easy approach to convert Microsoft Office files to PDFs such as PPT to PDF files or Excel files to PDFs
Using IronPDF, you can print PDF documents directly from URLs without using Adobe Acrobat Reader, just by using a few lines of code. Below is the code for printing PDF documents directly from URLs.
using IronPdf;
// Create a new PDF and print it
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
// Send the PDF to the default printer to print
// 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300, false);
using IronPdf;
// Create a new PDF and print it
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
// Send the PDF to the default printer to print
// 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300, false);
Imports IronPdf
' Create a new PDF and print it
Private renderer = New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
' Send the PDF to the default printer to print
' 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300, False)
Just run the above code and your URL will be converted to a PDF document and printing will begin. You can also save this file to read later.
Save the PDF file
Below is the output of the saved file that was printed.
The output PDF file from the NuGet website
This article has demonstrated how you can print PDF documents without using Adobe Acrobat by using IronPDF, a C# PDF library.
IronPDF provides a straightforward API that allows developers to create and edit PDF files with just a few lines of code. The library supports a wide range of file formats, including HTML, images, and Microsoft Office documents, making it easy to convert these formats to PDF. With IronPDF, you can easily print a PDF document directly from code, convert HTML files to PDF, and print PDF documents directly from URLs. The article has demonstrated how to install IronPDF using NuGet and provided code examples of how to print PDF documents from HTML files and URLs. For more advanced and detailed C# printing tutorials, please refer to the library documentation pages, specifically this tutorial and this code example.
IronPDF is free for development purposes but requires a license for commercial use. You can get additional information on licensing from our Licensing page.
9 .NET API products for your office documents