Skip to main content

Setting Print Options

Version: 4.0

Setting Print Options

Setting print options such as copies, scaling, paper size, etc., is a breeze when using DynamicPDF Print Manager for .NET. The following C# example shows you how.

How to Set Print Options​

Below are the steps and C# sample code to set print options using DynamicPDF PrintManager for .NET.

Steps for Setting Print Options​

  1. Create a PrintJob object with printer name and PDF document.
  2. Set Copies.
  3. Set Scaling.
  4. Set PrintAnnotations.
  5. Set paper size (SetPaperSizeByName).
  6. Set paper source (SetPaperSourceByName).
  7. Print using the PrintJob instance.

Sample Code - C#​

PrintJob printJob = new PrintJob("Printer Name", "DocumentA.pdf");

printJob.PrintOptions.Copies = 2;
printJob.PrintOptions.Scaling = PageScaling.ActualSize;
printJob.PrintOptions.PrintAnnotations = false;
printJob.PrintOptions.SetPaperSizeByName("Legal");
printJob.PrintOptions.SetPaperSourceByName("Tray 2");

printJob.Print();

GitHub Project​

Examples are provided in C# and VB.NET. Clone or view the example project at GitHub. This example contained on this page are in the following files.

View source on GitHub: DynamicPDF PrintManager Examples

Getting Started​

NuGet Package​

The easiest way to install DynamicPDF Rasterizer for .NET is by obtaining the NuGet package using Visual Studio's Package Manager. You can also obtain the NuGet package by downloading it directly. Refer to the installation documentation for more information.

Get ceTe.DynamicPDF.Printing.NET from NuGet

DynamicPDF PrintManager Information​

More information can be found here: