After updating iPhone from 17.4 to 17.5.1 UIPrintPageRenderer completely hangs app when getting NumberOfPages from Renderer.
var render = new UIPrintPageRenderer();
if (webViewPages != null && reportIndex < webViewPages.Length) { render.AddPrintFormatter( webViewPages[reportIndex].ViewPrintFormatter, 0); } else { render.AddPrintFormatter( new UIMarkupTextPrintFormatter(reportContent), 0); }
var printable = CoreGraphics.CGRectExtensions.Inset(page, 0, 0);
render.SetValueForKey(NSValue.FromCGRect(page), new NSString("paperRect"));
render.SetValueForKey(NSValue.FromCGRect(printable), new NSString("printableRect"));
var pdfData = new NSMutableData();
UIGraphics.BeginPDFContext(pdfData, page, null);
int pageNum = 0;
for (pageNum = 0; pageNum < render.NumberOfPages; pageNum++)
{
UIGraphics.BeginPDFPage();
var bounds = UIGraphics.PDFContextBounds;
render.DrawPage(pageNum, bounds);
}
UIGraphics.EndPDFContext();