public PMStatusCode TryPrintFile(PMPrintSettings settings, PMPageFormat pageFormat, NSUrl fileUrl, string mimeType = null) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (fileUrl == null) { throw new ArgumentNullException(nameof(fileUrl)); } IntPtr mime = CFString.LowLevelCreate(mimeType); var code = PMPrinterPrintWithFile(handle, settings.handle, pageFormat == null ? IntPtr.Zero : pageFormat.handle, mime, fileUrl.Handle); if (mime != IntPtr.Zero) { CFObject.CFRelease(mime); } return(code); }