Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The following code causes a SIGSEGV:
var info = new CGPDFInfo()
AllowsCopying = true,
AllowsPrinting = true,
Author = "My Name",// Setting any string property crashes
UIGraphics.BeginPDFContext(file, RectangleF.Empty, info);
The stack trace is as follows:
>at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr (intptr,intptr,intptr,intptr) <IL 0x00026, 0xffffffff>
>at MonoTouch.Foundation.NSMutableDictionary.LowlevelSetObject (MonoTouch.Foundation.NSObject,intptr) [0x00011] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSMutableDictionary.cs:394
>at MonoTouch.CoreGraphics.CGPDFInfo.ToDictionary () [0x00033] in /Developer/MonoTouch/Source/monotouch/src/shared/CoreGraphics/CGContextPDF.cs:161
>at MonoTouch.UIKit.UIGraphics.BeginPDFContext (string,System.Drawing.RectangleF,MonoTouch.CoreGraphics.CGPDFInfo) [0x00000] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIGraphics.cs:99
mt master: f4c733ab71e60b47264aa08b8f77412e3a730fac
mt ios6: 185a3928929b296da36adb39b4edecf603044728
The next release with this fix will likely be 6.0.9 (another stable release is coming soon and it's too late to get into that stable release). I can get you a hotfix if you can't work around it in the meantime.
Thanks for the quick response
Some code that demonstrates how to create an NSDictionary by hand and use that in stead of CGPDFInfo would be great. Could you point me in the right direction?
Here is the code that creates the NSDictionary from the CGPDFInfo: https://github.com/mono/maccore/blob/master/src/CoreGraphics/CGContextPDF.cs#L154 - it shouldn't be too hard to copy that and make it work in your own app.
Thank you, it works! Your quick responses are really appreciated.