CGPDF<...> - where are the setters?

Hi there,


Is there any way to create PDF objects (e.g. a PDF-dictionary with parameters that are needed by a custom PDF producer/consumer/viewer) with CGPDF<...> or do I have to write my own parser and create new trailers, xref etc. in order to add new objects to the PDF? As I understand it, CG translates all drawing calls of its graphics context into the correct PDF counterparts when creating a PDF - but I have custom data/objects (e.g. for annotations, threads etc.) that should be stored in the PDF but that obviously can't be automatically created by CG.


I can only find all these getters


Getting Data from a Dictionary


CGPDFDictionaryGetArray

CGPDFDictionaryGetBoolean

CGPDFDictionaryGetCount

CGPDFDictionaryGetDictionary

CGPDFDictionaryGetInteger

CGPDFDictionaryGetName

CGPDFDictionaryGetNumber

CGPDFDictionaryGetObject

CGPDFDictionaryGetStream

CGPDFDictionaryGetString


Any help would be appreciated ?


And by the way - does anyone know some links where I can find out what one can achieve in the real world with this function and its callback .

CGPDFDictionaryApplyFunction

CGPDFDictionaryApplierFunction

Maybe a sample application to see it in action?


Thx in advance

I haven't looked too much into this (I'm going to be shortly in the same situation myself), but I haven't found anything that translates a PDF into an object graph.


Have you tried looking at Image IO, a companion framework for Core Graphics?

I'm not really familiar with this area, but you can pass in an auxiliary info dictionary to CGPDFContextCreate(), page properties to CGPDFContextBeginPage(), and XML metadata to CGPDFContextAddDocumentMetadata(). There are also CGPDFContextAddDestinationAtPoint(), CGPDFContextSetDestinationForRect(), and CGPDFContextSetURLForRect() for making clickable areas in the PDF.

Actually all my code works fine but I am handwriting the PDFs in a Hex-Editor.

Now I'm looking for a way to bring it into the PDF without having to do all the

parsing stuff first...


Like the CG set does a good job in abstracting away everything of the PDF reference

when retrieving information from a PDF I thought there must be something to bring

additional objects back to the PDF on the same abstraction level.

CGPDF&lt;...&gt; - where are the setters?
 
 
Q