views:

139

answers:

2

Hello friend,

I am trying to read a PDF on iPhone, I got to know that we can get the info about PDF from CGPDFDocumentGetCatalog method. But, this method returns a CGPDFDictionaryRef. I have browsed through the documentation and didn't find any method to extract its Key/Values. Please help me if anybody has solution for the problem. Or you can tell if we can have any other way to extract data from PDFs.

A: 

Hi,

It seems that you have to extract the names of the values first. Take a look to this site especially the allScriptsInPDFDocument method

ReaperXmac
Thanks for your help, but, the libraries and code used their were for MAC OS and are currently unavailable in iPhone OS.
Amit Gupta
A: 

I have just checked out the documentation and it has a load of functions for getting key value pairs. If you don't know what the keys are you can use CGPDFDictionaryApplyFunction to with an appropriate callback.

Alternatively, check out the PDF Specification for a detailed description of the catalog (section 7.7.2).

JeremyP
Hi Jeremy, thanks for your help. But now a new problem have cropped up. I am getting error while creating content stream. See the following line: -myContentStream = CGPDFContentStreamCreateWithPage(myPage);Can you help me in this case.
Amit Gupta
Sorry, you need to give more context e.g. what is the specific error.
JeremyP