You have clearly indicated how to do this, all you have to do is collect and try until it works.
First of all, you need to set up a table with callbacks when you indicate yourself at the beginning of your question (all code in Objective-C, NOT Swift):
CGPDFOperatorTableRef operatorTable = CGPDFOperatorTableCreate(); CGPDFOperatorTableSetCallback(operatorTable, "q", &op_q); CGPDFOperatorTableSetCallback(operatorTable, "Q", &op_Q);
This table contains a list of PDF statements for which you want to receive an invitation, and associates a callback with them. These callbacks are just functions that you define elsewhere:
static void op_q(CGPDFScannerRef s, void *info) {
And then you create a scanner and run it, passing it the information that you just defined.
CGPDFScannerScan (contentStreamScanner);
If you want to see a complete example with source code on how to find and process images, check out this site .
source share