Forum Xamarin.Mac


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Unable to print image using NSPrintOperation


I am trying to print an image which is NSImage. I am using NSPrintOperation but page is always blank. I am not sure what I am missing. please have a look at below code

NSView nSImageView = NSImageView.FromImage(badgeImage);
NSPrintOperation printOperation = NSPrintOperation.FromView(nSImageView,NSPrintInfo.SharedPrintInfo);
printOperation.JobTitle= $"Print badge : {documentName}";
printOperation.ShowsPrintPanel = true;

Note- documentName is a string. badgeImage is a NSImage object

Sign In or Register to comment.