Back to Devexpress

PdfPrinterSettings Class

officefileapi-devexpress-dot-pdf-7dab0cc1.md

latest4.3 KB
Original Source

PdfPrinterSettings Class

Provides the additional printer settings to a PDF Viewer.

Namespace : DevExpress.Pdf

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

NuGet Package : DevExpress.Pdf.Drawing

Declaration

csharp
public class PdfPrinterSettings
vb
Public Class PdfPrinterSettings

The following members return PdfPrinterSettings objects:

LibraryRelated API Members
WinForms ControlsPdfPageSetupDialogShowingEventArgs.PrinterSettings
PdfViewer.ShowPrintPageSetupDialog()
WPF ControlsPageSetupDialogShowingEventArgs.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

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

Inheritance

Object PdfPrinterSettings

See Also

PdfPrinterSettings Members

DevExpress.Pdf Namespace