tags:

views:

190

answers:

1

I have parsed the pdf data using the following code.

NSString *pdfPath = [[NSBundle mainBundle] pathForResource:@"GameKit_Guide" ofType:@"pdf"];
const char *filename = [pdfPath UTF8String];
pdfDocument = GetPDFDocumentRef(filename);//user function to get pdf in pdfdocument form.
myTable = CGPDFOperatorTableCreate();
CGPDFOperatorTableSetCallback (myTable, "MP", &op_MP);  
CGPDFOperatorTableSetCallback (myTable, "DP", &op_DP);    
CGPDFOperatorTableSetCallback (myTable, "BMC", &op_BMC);
CGPDFOperatorTableSetCallback (myTable, "BDC", &op_BDC);
CGPDFOperatorTableSetCallback (myTable, "EMC", &op_EMC);

int k;
int numOfPages = CGPDFDocumentGetNumberOfPages (pdfDocument);
for (k = 0; k < numOfPages; k++) 
{
 myPage = CGPDFDocumentGetPage (pdfDocument, k + 1 );
 myContentStream = CGPDFContentStreamCreateWithPage (myPage);
 myScanner = CGPDFScannerCreate (myContentStream, myTable, NULL);
 CGPDFScannerScan (myScanner);
}

So the code is present in myContentStream after parsing. So how should i display it back into the UIWebView? I couldnt find any function to do so. Plz help...

A: 

Hey Friend,

I am trying to get data from pdf.

I got error "_GetPDFDocumentRef", referenced from:

CGPDFDocumentRef pdfDocument;

pdfDocument = GetPDFDocumentRef(filename);

Can you tell me what i am missing here?

What i have to do in that function?

Thank You,

Jindal
You have to write the code to convert the file into CGPDFDocumentRef form. Then only we can do all the remaining steps. You will get the idea and what all is happening there if you refer to this page http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html#//apple_ref/doc/uid/TP30001066-CH220-TPXREF101
wolverine
hey, thank you for your reply,i used following code but its not getting any data.CGPDFDocumentRef myDocument;myDocument = CGPDFDocumentCreateWithURL(url);"url" suggest path of pdf file. (it giving 0x0)can you suggest me in this case.
Jindal