Bug 10916 - Please add binding for CGPDFDocumentGetInfo
Summary: Please add binding for CGPDFDocumentGetInfo
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2013-03-05 12:22 UTC by Paul Auman
Modified: 2013-03-05 16:41 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Paul Auman 2013-03-05 12:22:00 UTC
Missing Binding for CGPDFDocumentGetInfo

Gets the information dictionary for a PDF document.

CGPDFDictionaryRef CGPDFDocumentGetInfo (
   CGPDFDocumentRef document
);
Parameters
document
The document whose dictionary you want to obtain.
Return Value
The information dictionary for the document.

Availability
Available in iOS 2.0 and later.
Declared In
CGPDFDocument.h


http://developer.apple.com/library/ios/#Documentation/GraphicsImaging/Reference/CGPDFDocument/Reference/reference.html
Comment 1 Sebastien Pouliot 2013-03-05 15:44:20 UTC
Good catch, it will be added for the next version (but it's too late for 6.2.1).

Let me know if this is blocking you - it's only a few lines of code that you can add in your application.
Comment 2 Sebastien Pouliot 2013-03-05 16:14:28 UTC
Fixed in maccore/master: cd577d54f58b290cfa3cb292d619d86ca0aab64b
Unit test added in master: a74322724d1cd3905b24d7842b5c5a31d4b8ef10
Comment 3 Paul Auman 2013-03-05 16:35:57 UTC
Thank you. Tried a couple different ways to pull it out of the PDFstream, no luck. If you have a chance please post the code to call it directly, it would be most helpful.

Cheers,

Paul
Comment 4 Sebastien Pouliot 2013-03-05 16:41:56 UTC
That's the commit:

https://github.com/mono/maccore/commit/cd577d54f58b290cfa3cb292d619d86ca0aab64b

Something like this should work in your app:

[DllImport ("/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics")]
extern static IntPtr CGPDFDocumentGetInfo (IntPtr handle);

public CGPDFDictionary GetInfo (CGPDFDocument doc)
{
   return new CGPDFDictionary (CGPDFDocumentGetInfo (doc.Handle));
}