views:

147

answers:

0

I have a method where I draw a PDF to a bitmap. Once in a while I see this error in the log when running it on an actual device (not simulator):

<Error>: FT_Select_Charmap failed: error 6

The error is occurring at the marked line (#11):

NSURL *url = [NSURL fileURLWithPath:pdfFilePath];
CGPDFDocumentRef documentRef = CGPDFDocumentCreateWithURL((CFURLRef)url);
CGPDFPageRef pageRef = CGPDFDocumentGetPage(documentRef, 1);
UIGraphicsBeginImageContext(frame.size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(ctx, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect(ctx, CGContextGetClipBoundingBox(ctx));
CGContextTranslateCTM(ctx, 0.0, frame.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(pageRef, kCGPDFCropBox, frame, 0, true));
CGContextDrawPDFPage(ctx, pageRef); // ERROR HERE
UIImage *pdfImage = UIGraphicsGetImageFromCurrentImageContext(); // Is this retained???
UIGraphicsPopContext();
CGPDFDocumentRelease(documentRef);