Generating TIFF from PDF - solved transparency problem.
Generating TIFF from PDF - solved transparency problem.
- Subject: Generating TIFF from PDF - solved transparency problem.
- From: Rustam Muginov <email@hidden>
- Date: Tue, 09 Nov 2004 13:28:34 +0300
Recently I'd encountered a problem then creating raster implementation of
PDF file.
I was using
NSImage *image = [[NSImage alloc] initWithContentsOfFile: inFile];
NSData *tiffData = [image TIFFRepresentation];
[tiffData writeToFile: @"MyTiffFile.tiff" atomically: YES];
and depending from PDF file, I was getting sometime TIFF with transparency
sometime without. I was searching on the web, including
http://cocoa.mamasam.com, for a long time but didn't found the solution.
Occasionaly, I'd modified the code to the following:
NSImage *image = [[NSImage alloc] initWithContentsOfFile: inFile];
[image setBackgroundColor: [NSColor whiteColor] ];
NSData *tiffData = [image TIFFRepresentation];
[tiffData writeToFile: @"MyTiffFile.tiff" atomically: YES];
And this magicaly solved the problem. All the TIFF generated have now white
background instead of transparent.
Hope someone would find it helpful.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden