Examples

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.


Clone or View Example Project on GitHub

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.

NuGet Package ID: ceTe.DynamicPDF.Printing.NET

DynamicPDF PrintManager Information


More information can be found here:


Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 22 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!