Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfPrinterSettings Class

Provides the additional printer settings to a PDF Viewer.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.2.Drawing.dll

NuGet Package: DevExpress.Pdf.Drawing

#Declaration

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()

#Remarks

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:

#Example

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);

#Inheritance

Object
PdfPrinterSettings
See Also