PDFPage initWithImage: strange behavior

300 Views Asked by At

I can't understand the difference. It seams to be the same but is not!

Does enybody know why?

// Working:
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:
[[NSImage alloc]initWithContentsOfFile:imagePath]];


// NOT Working:
NSImage *image = [[NSImage alloc]initWithContentsOfFile:imagePath];                           
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:image];
1

There are 1 best solutions below

0
On BEST ANSWER

Here's the solution:

NSImage *image = [[NSImage alloc]initWithContentsOfFile:imagePath]; 
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:(CIImage *) image];