Bug 14 - CGPDFDocumentGetCatalog missing
Summary: CGPDFDocumentGetCatalog missing
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 1.0
Hardware: Other Other
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-07-18 13:29 UTC by Berndt H.
Modified: 2011-07-28 10:41 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Berndt H. 2011-07-18 13:29:43 UTC
I would like to get the catalog for a PDF, but in MonoTouch I can not find the GetCatalog method on the CGPDFDocument class.

In Xcode I would use:
CGPDFDictionaryRef pdfDocDictionary = CGPDFDocumentGetCatalog(pdfDocument);

In MonoTouch I come this far:
CGPDFDocument newDoc = CGPDFDocument.FromUrl (this.oUrl.ToString ());
Comment 1 Sebastien Pouliot 2011-07-18 17:10:54 UTC
Look like this is not yet part of the bindings. According to the documentation [1] you should be able to use it using something (untested) like:

[System.Runtime.InteropServices.DllImport ("/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/CoreGraphics")]
extern static IntPtr CGPDFPageGetDictionary (IntPtr pageHandle);

CGPDFDictionary dict = new CGPDFDictionary (CGPDFPageGetDictionary (newDoc.Handle));

[1] http://developer.apple.com/library/mac/#documentation/graphicsimaging/Reference/CGPDFDocument/Reference/reference.html
Comment 2 Sebastien Pouliot 2011-07-18 17:28:50 UTC
oops, sorry that was a bad copy/paste:

[System.Runtime.InteropServices.DllImport ("/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics")]
extern static IntPtr CGPDFDocumentGetCatalog (IntPtr docHandle);

IntPtr handle = CGPDFDocumentGetCatalog (oDoc.Handle);
CGPDFDictionary dict = new CGPDFDictionary (handle);

That will compile/execute correctly (wont crash). I'll check for what's should be inside the dictionary (i.e. does it really work) later and if it's alright I'll commit the missing binding code :-)