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
- Create a
PrintJob
object with printer name and PDF document. - Set
Copies
. - Set
Scaling
. - Set
PrintAnnotations
. - Set paper size (
SetPaperSizeByName
). - Set paper source (
SetPaperSourceByName
). - 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.
- C# - PrintOptions.cs
- VB.NET - PrintOptions.vb
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.
DynamicPDF PrintManager Information
More information can be found here: