This topic provides information about the following:
The following example demonstrates using the System.Windows.Controls.Canvas class and how to have a function that can print different file types, (images, PDF, CAD, etc.). This is done by loading the file in an ImGearPage, drawing the ImGearPage to a new Canvas, then printing that Canvas.
Be sure to add the required references to your project for the formats you are printing.
The above snippet uses Native Scaling. More information on Native Scaling and WPF scaling can be found here:
The following example demonstrates how to print using the ImGearPageDisplay.Print method. This method draws the image on .NET graphics for printing.
Native PDF document printing renders the document directly to the printer; it’s fast and requires less memory. The following is an example that demonstrates how to print a PDF with the ImGearPDFDocument.Print() method.
The .NET reference System.Drawing.dll is required for this snippet.
ImageGear23.Formats.Pdf Assembly > ImageGear.Formats.PDF Namespace : ImGearPDFPrintOptions Class
ImageGear23.Twain Assembly > ImageGear.TWAIN Namespace : ImGearPrinter Enumeration
ImageGear23.Wpf Assembly > ImageGear.WPF.XPS Namespace > ImGearXPSDocument Class : Print Method
ImageGear.Web.UI Library > ImageGear.Web.UI_namespace > ImageGear.Web.UI.PageView : showPrintDialog Method
ImageGear.Web.UI Library > ImageGear.Web.UI_namespace > ImageGear.Web.UI.PageView : print Method