Bug 991 - CGPDFArray.GetString() is still unbound
Summary: CGPDFArray.GetString() is still unbound
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-22 08:06 UTC by René Ruppert
Modified: 2012-01-16 09:10 UTC (History)
3 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 René Ruppert 2011-09-22 08:06:22 UTC
CGPDFDictionary.GetString() has lately been bound (thanks Sebastien!) but it is missing for CGPDFArray.
Comment 1 Sebastien Pouliot 2011-09-22 13:38:13 UTC
Provide me a test case for it and I'll add it tonight :-)
Comment 2 René Ruppert 2011-09-25 15:16:25 UTC
Test case? Just copy the code from CGPDFDictionary. I can even give you the code!
Tested and verified.

[DllImport (Constants.CoreGraphicsLibrary)]
extern static bool CGPDFArrayGetString (IntPtr handle, int index, out IntPtr result);

/// <summary>
/// Monotouch 4.2 bug: CGPDFArray.GetString() is not implemented.
/// </summary>
/// <returns>
public static bool GetStringFromPdfArray (CGPDFArray aPdfArray, int index, out string result)
{
	IntPtr res;
	if (CGPDFArrayGetString (aPdfArray.Handle, index, out res)) {
		result = PdfStringToString (res);
		return true;
	}
	result = null;
	return false;
}
Comment 3 Sebastien Pouliot 2011-09-25 19:54:34 UTC
It's not a code issue :-) MT had CGPDFDictionary.GetString code but it did not work (as you found out) and testing it takes less time than rebuilding monotouch-4.2 branch. Anyway since you confirm it's identical (utf8) to CGPDFDictionary I committed the code to master. Thanks!

ref: 5319c45014d1c920ad6bfa06b2a859cc0cf8730c
Comment 4 René Ruppert 2012-01-13 07:25:31 UTC
I'm currently on Monotouch 5.1.1 and CGPDFArray.GetString() is still/again missing. It is there for CGPDFDictionary() though.
Comment 5 Sebastien Pouliot 2012-01-13 07:55:57 UTC
That's weird, I have it on 5.1.2 and I don't recall any change in that sector. I'll check this asap.
Comment 6 Sebastien Pouliot 2012-01-13 10:30:07 UTC
Someone else confirmed me the method is present in 5.1.1. Could you be using a _stale_ monotouch.dll binary ? (like one I provided in a old bug report ?)
Comment 7 René Ruppert 2012-01-13 15:12:11 UTC
No, I was on MT 5.0.4 and then upgraded using MD's updater after changing it to show beta downloads.
It also offers Mono 2.8.10 I think but even after installing that it keeps on offering it. 
I will downgrade to MT 5.0.x and install the latest beta again and see if that helps.
But maybe it is just an issue of the intellisense? I don't see the method there. WIll try to build the code even if it is not shown. I'll keep you posted.
Comment 8 René Ruppert 2012-01-16 03:28:41 UTC
Oh well, I put too much trust in the intellisense. The code is building just fine but MD has no idea about the GetString() method.
Comment 9 Sebastien Pouliot 2012-01-16 09:10:44 UTC
You might want to report this to #monodevelop (bug report or IRC)