failed to find PDF header: '%PDF' not found in xCode
- by Alexander
I'm trying to create a PDF Object from binary XString in xCode. (OData from SAP, utf-8)
Here is the coding:
const char* buf = [temp1 UTF8String];
pdffile = [NSData dataWithBytes:buf length:length1];
[webDisplay loadData:self.pdffile MIMEType:@"application/pdf" textEncodingName:@"utf-8" baseURL:nil];
self.webDisplay.scalesPageToFit = YES;
temp1 is a XString
length1 is the length of PDF file in bytes.
I get following error message:
failed to find PDF header: '%PDF' not found
Some ideas?
Thanks!