• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Generating TIFF from PDF - solved transparency problem.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: New Spotlight Info
  • Next by Date: Re: Getting the desktop background
  • Previous by thread: Re: Nibs and memory leaks
  • Next by thread: How do I do this / are there examples?
  • Index(es):
    • Date
    • Thread