PdfViewerControl.Print(PdfPrinterSettings, Boolean, Int32) Method
In This Article
OBSOLETE
Use the Print method instead.
Prints the current document using the specified PDF print settings without invoking the Print dialog.
Namespace: DevExpress.Xpf.PdfViewer
Assembly: DevExpress.Xpf.PdfViewer.v24.2.dll
NuGet Package: DevExpress.Wpf.PdfViewer
#Declaration
[Obsolete("Use the Print(PdfPrinterSettings printerSettings, bool showPrintStatus = true) overload of this method instead.")]
public virtual void Print(
PdfPrinterSettings printerSettings,
bool showPrintStatus,
int maxPrintingDpi
)
#Parameters
Name | Type | Description |
---|---|---|
printer |
Pdf |
A Pdf |
show |
Boolean | true, to show the printing status; otherwise, false. |
max |
Int32 | An integer value that is the maximum printing DPI. |
#Remarks
This example shows how to print a document with custom printer settings.
using DevExpress.Pdf;
using System.IO;
using System.Reflection;
using System.Windows;
namespace LoadPDFDocument {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
Stream stream = GetResourceStream("LoadPDFDocument.Demo.pdf");
Viewer.DocumentSource = stream;
}
static Stream GetResourceStream(string resourceName) {
return Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName);
}
private void Viewer_DocumentLoaded(object sender, RoutedEventArgs e) {
PdfPrinterSettings settings = new PdfPrinterSettings();
settings.PageNumbers = new int[] { 2, 3, 4 };
settings.PageOrientation = PdfPrintPageOrientation.Landscape;
settings.PrintingDpi = 400;
settings.ScaleMode = PdfPrintScaleMode.ActualSize;
Viewer.Print(settings, false, 600);
}
}
}
See Also