officefileapi-devexpress-dot-pdf-7dab0cc1.md
Provides the additional printer settings to a PDF Viewer.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Drawing.dll
NuGet Package : DevExpress.Pdf.Drawing
public class PdfPrinterSettings
Public Class PdfPrinterSettings
The following members return PdfPrinterSettings objects:
| Library | Related API Members |
|---|---|
| WinForms Controls | PdfPageSetupDialogShowingEventArgs.PrinterSettings |
| PdfViewer.ShowPrintPageSetupDialog() | |
| WPF Controls | PageSetupDialogShowingEventArgs.PrinterSettings |
| PdfViewerControl.ShowPrintPageSetupDialog() |
Create a PrinterSettings instance and pass it to a PdfPrinterSettings object constructor to specify the standard printer settings.
To apply the specified PDF printer settings, pass the PdfPrinterSettings object as a parameter to one of the following methods:
The code example below prints a document with custom printer settings.
View Example: PDF Document API - Specify the PDF Printer Settings
using DevExpress.Pdf;
// Create a Pdf Document Processor instance
// and load a PDF file
PdfDocumentProcessor documentProcessor = new PdfDocumentProcessor();
documentProcessor.LoadDocument(@"..\..\Demo.pdf");
// Declare printer settings.
PdfPrinterSettings pdfPrinterSettings = new PdfPrinterSettings();
// Specify printer settings.
pdfPrinterSettings.PageOrientation = PdfPrintPageOrientation.Portrait;
pdfPrinterSettings.PageNumbers = new int[] { 1, 3, 4, 5 };
// Specify the custom scale number
pdfPrinterSettings.ScaleMode = PdfPrintScaleMode.CustomScale;
pdfPrinterSettings.Scale = 90;
// Specify .NET printer settings
PrinterSettings settings = pdfPrinterSettings.Settings;
settings.Duplex = Duplex.Vertical;
settings.Copies = 3;
// Print the document
documentProcessor.Print(pdfPrinterSettings);
Imports DevExpress.Pdf
' Create a Pdf Document Processor instance
' and load a PDF into it.
Dim documentProcessor As New PdfDocumentProcessor()
documentProcessor.LoadDocument("..\..\Demo.pdf")
' Declare the PDF printer settings.
Dim pdfPrinterSettings As New PdfPrinterSettings()
' Specify the PDF printer settings.
pdfPrinterSettings.PageOrientation = PdfPrintPageOrientation.Portrait
pdfPrinterSettings.PageNumbers = New Integer() { 1, 3, 4, 5 }
' Specify the custom scale number
pdfPrinterSettings.ScaleMode = PdfPrintScaleMode.CustomScale
pdfPrinterSettings.Scale = 90
' Specify .NET printer settings
Dim settings As PrinterSettings = pdfPrinterSettings.Settings
settings.Duplex = Duplex.Vertical
settings.Copies = 3
' Print the document using the specified printer settings.
documentProcessor.Print(pdfPrinterSettings)
Object PdfPrinterSettings
See Also