I have been using the following code to write out images to a PDF file that I am creating on the fly to attach to an email.
// Write the annotation icon
NSString * imagePath = [[NSBundle mainBundle] pathForResource: [[imageName lastPathComponent] stringByDeletingPathExtension] ofType:[imageName pathExtension]];
PTSDFDoc *sdfDoc = [doc GetSDFDoc];
@try {
PTImage *img = [PTImage Create: sdfDoc filename: imagePath];
element = [eb CreateImageWithCornerAndScale:img x:leftMargin y:(lineY - 5) hscale:14 vscale:14];
[ew WritePlacedElement: element];
}
@catch (NSException *exc) {
[theAppDelegate logException:exc withMessage:@“Unable to write the annotation icon in createAnnotationsPDF.”];
}
Recently, since upgrading to iOS 9, this code has stopped working. It throws the following exception when it calls [PTImage Create…]:
exc NSException * name: @“PDFNet Exception” - reason: @“Failed to embed PNG image” 0x0000000136d028e0
I have PNG compression turned off in my XCode project settings.
Can you help me to resolve this issue?
David