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
Related API Members
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:
- PdfViewer.Print(PdfPrinterSettings) (WinForms)
- PdfViewerControl.Print(PdfPrinterSettings, Boolean) (WPF)
- PdfDocumentProcessor.Print(PdfPrinterSettings) (Office File API)
Example
The code example below prints a document with custom 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