EvoPdf Classic · PDF Print

EVO PDF Print for .NET

EVO PDF Print for .NET can be used in any type of .NET application to silently print PDF documents without displaying any print dialog. It can be integrated into any .NET application, both ASP.NET web sites and desktop applications, to add PDF Print capabilities to your application. You can select the printer, paper size, orientation, margins, add watermarks and stamps during printing.

Classic v14.0 · Windows, .NET Framework 4.0+ and .NET 6–10 · Evaluate without registration — demo mode by default (watermarked) · Licensed with the EVO PDF Toolkit

$dotnet add package EvoPdf.PdfPrint

Windows · .NET Framework 4.0+ and .NET 6–10 (.NET Standard 2.0)

Program.csC#
using EvoPdf.PdfPrint;

var pdfPrint = new PdfPrint();
pdfPrint.PrinterSettings.PrinterName = "Office";
// all pages: startPage 1, endPage 0
pdfPrint.Print("document.pdf", 1, 0);
Classic API: EvoPdf.PdfPrint namespace, one converter class, synchronous calls. API reference →
  • Windows 10 / 11 / Server 2016–2025
  • .NET Framework 4.0 – 4.8.1
  • .NET 6 → 10, .NET Standard 2.0
  • Azure Cloud Services & Virtual Machines
  • Web, console and desktop applications
Features

What the PDF Print component does

  • Print PDF documents from files, streams or memory buffers
  • Silently print without displaying any print dialog
  • Does not depend on Adobe Reader or other third party tools
  • Allows you to select the printer to be used for printing
  • Allows you to select the paper size, orientation and margins
  • Print password protected PDF documents
  • Add watermarks and stamps during printing
  • Print only a range of PDF pages
  • Get the number of pages in a PDF document
  • Support for .NET 4.0 framework and later
  • Documentation and C# samples for all the features
In detail

EVO PDF Print for .NET — how it works

EVO PDF Print for .NET can be used in any type of .NET application to silently print PDF documents without displaying any print dialog. The integration with existing .NET applications is extremely easy and no installation is necessary. The downloaded archive contains the assembly for .NET and a demo application.

The full C# source code for the demo application is available in the Samples folder. You can select the printer, set the paper size, orientation and margins, print in color or in gray scale, select the range of PDF pages to print. EVO PDF Print does not depend on Adobe Reader or other third party tools.

The code below was taken from the PDF Print demo application available for download in the PDF Print product package. In this sample an instance of the PdfPrint class is constructed and used to silently print a selected PDF document.

At a glance

Component
EvoPdf Classic · PDF Print
NuGet package
EvoPdf.PdfPrint
Namespace
EvoPdf.PdfPrint
Main class
PdfPrint
Runs on
Windows · .NET Framework 4.0+ · .NET 6–10 (.NET Standard 2.0)
Version
Classic v14.0
License
EVO PDF Toolkit; evaluation without registration
Documentation →
Sample.csC#
private void btnPrintPdf_Click(object sender, EventArgs e)
{
    if (pdfFileTextBox.Text.Trim().Equals(String.Empty))
    {
        MessageBox.Show("Please choose a source PDF file", "Choose PDF file", MessageBoxButtons.OK);
        return;
    }

    // the source pdf file
    string pdfFileName = pdfFileTextBox.Text.Trim();

    // start page number
    int startPageNumber = int.Parse(textBoxStartPage.Text.Trim());
    // end page number
    // when it is 0 the conversion will continue up to the end of document
    int endPageNumber = 0;
    if (textBoxEndPage.Text.Trim() != String.Empty)
        endPageNumber = int.Parse(textBoxEndPage.Text.Trim());

    // create the PDF printer 
    PdfPrint pdfPrint = new PdfPrint();

    // set the license key

    // set the document name
    pdfPrint.DocumentName = "PDF Silent Printing";

    // enable or disable color printing
    pdfPrint.DefaultPageSettings.Color = cbPrintColor.Checked;

    // set the PDF printing color and resolution
    pdfPrint.Color = GetSelectedPrintColor();
    pdfPrint.Resolution = int.Parse(textBoxResolution.Text);

    // select the printer
    string selectedPrinterName = GetSelectedPrinterName();
    if (selectedPrinterName != null)
        pdfPrint.PrinterSettings.PrinterName = selectedPrinterName;

    // set paper size
    PaperSize selectedPaperSize = GetSelectedPaperSize();
    if (selectedPaperSize != null)
        pdfPrint.DefaultPageSettings.PaperSize = selectedPaperSize;

    // set paper orientation
    pdfPrint.DefaultPageSettings.Landscape = GetSelectedPageOrientation() == "Landscape";

    // set paper margins 
    pdfPrint.DefaultPageSettings.Margins = new Margins((int)(float.Parse(leftMarginTextBox.Text) * 100),
        (int)(float.Parse(rightMarginTextBox.Text) * 100),
        (int)(float.Parse(topMarginTextBox.Text) * 100),
        (int)(float.Parse(bottomMarginTextBox.Text) * 100));

    // the demo output directory
    string outputDirectory = Path.Combine(Application.StartupPath, @"DemoFiles\Output");

    Cursor = Cursors.WaitCursor;

    try
    {
        pdfPrint.Print(pdfFileName, startPageNumber, endPageNumber);
    }
    catch (Exception ex)
    {
        // The conversion failed
        MessageBox.Show(String.Format("An error occurred. {0}", ex.Message), "Error");
        return;
    }
    finally
    {
        Cursor = Cursors.Arrow;
    }

    MessageBox.Show("Print Completed", "Print Completed", MessageBoxButtons.OK);
}
Licensing

Perpetual licenses, updates and support included for a year

The HTML to PDF Converter license (450 USD Deployment / 1200 USD Company) covers the Classic and the Next converter; the EVO PDF Toolkit (650 / 1400 USD) covers every component on this site, Classic tools included. The Company License includes redistribution.