Print PDF functionality Not worked on Latest MAC using Xamarin MAC application

298 Views Asked by At

We have a Print PDF document functionality in our Xamarin MAC application. Previously the print function was worked well with old MAC OS and right now we have tried to print the PDF document from the new MAC OS “Sierra” and found that it is not showing the details or contents in the Print preview page. Also its not printing any content. We are using the below code to print the PDF.

if (Path.GetExtension (filenames [0]).ToLower () == ".pdf") 
{
     var fileUrl = NSUrl.FromFilename (filePath);
     PdfDocument aPdfDocument = new PdfDocument(fileUrl);
     PdfView aPDFView = new PdfView();
     aPDFView.Document = aPdfDocument;
     inv.Window.ContentView.AddSubview (aPDFView);
      var pr = NSPrintInfo.SharedPrintInfo;
      pr.VerticallyCentered = false;
      pr.TopMargin = 2.0f;
      pr.BottomMargin = 2.0f;
      pr.LeftMargin = 1.0f;
      pr.RightMargin = 1.0f;
      aPDFView.Print(this);
}

Could you please tell me how to solve this print issue in latest MAC OS?

0

There are 0 best solutions below