Re: Parsing PDF Content
Re: Parsing PDF Content
- Subject: Re: Parsing PDF Content
- From: John Goodman <email@hidden>
- Date: Wed, 10 Jan 2007 14:16:46 -0500
Oops, I blew right through the sample code without realizing that
CGPDFScannerCreate gives me to opportunity to pass data to my
callback. This is exactly what I was looking for. Thanks for quickly
pointing this out, and for gently steering me to the Quartz Dev list
for future questions of this sort.
John
On Jan 10, 2007, at 2:06 PM, David Duncan wrote:
On Jan 10, 2007, at 10:38 AM, John Goodman wrote:
Everything is fine, but now I want to fold the code into an
existing C++ application. I would like to have a pointer to a C++
object passed to the callback.
I see that Apple's callback has an "void *info" parameter. The
documentation describes the pointer as "A pointer to data passed
to the callback."
I could use the "void *info" parameter to pass a "this" pointer,
but I don't see any way for me to set up this value. Can I set the
pointer value myself? If so, how?
You set the "info" parameter when you create the scanner (via
CGPDFScannerCreate). Just pass "this" for the info parameter, then
type cast the void* back to your C++ class pointer and use it.
PS: This is not really the best list for questions about Core
Graphics APIs without a Cocoa context - you should use the Quartz
Dev list instead.
--
David Duncan
Apple DTS Quartz and Printing
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden