Forum Xamarin Xamarin.Mac

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.