I am trying to do a very simple thing but I am stuck.
I have loaded a PDF and I have a CGPDFDocumentRef.
Now I want to draw a rectangle on a page of this document.
I start with creating a graphic context to draw to.
The CGPDFContextCreate requires a CGDataConsumerRef.
I suppose that I have to create such a consumer by using
CGDataConsumerCreateWithCFData because the CGDataConsumerCreate
requires that I provide callbacks to put bytes and, obviously, I
don't know how to do it in the PDF format.
So now I need a CFMutableDataRef representing the PDF page and pass
it to CGDataConsumerCreateWithCFData.
And here I am stuck... How do I retrieve a CFMutableDataRef from a
CGPDFPageRef for creating a data consumer?