Exception when calling PTImage Create

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?


could you post, or email to support at pdftron.com the image in question?

also, are you able to use that png in the AddImageTest sample that comes with the SDK? Or does the error only happen in your project?