Re: Quartz over GhostScript
Re: Quartz over GhostScript
- Subject: Re: Quartz over GhostScript
- From: Ben Mackin <email@hidden>
- Date: Sun, 16 Jun 2002 15:01:15 -0700
on 6/14/02 8:20 PM, Vince DeMarco at email@hidden wrote:
>
That would be easy, write a small Cocoa Application that loads the PDF
>
into an NSImage and then tell that NSImage to get its
>
>
- (NSData *)TIFFRepresentation;
>
- (NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)comp
>
factor:(f
>
loat)aFloat;
>
>
and save the resulting NSData to disk.
Ok, in doing this I read up on the compressions I can use, and I fuond the
one I need:
NSTIFFCompressionCCITTFAX3
CCITT Fax Group 3 compression. It's for one-bit fax images sent over
telephone lines.
However, when I do this:
myPDF = [[NSImage alloc] initWithContentsOfFile:@"/tmp/send/myFile.pdf"];
myTiffData = [myPDF
TIFFRepresentationUsingCompression:NSTIFFCompressionCCITTFAX3 factor:nil];
[myTiffData writeToFile:@"/tmp/send/Output.tif" atomically:YES];
The resulting image is a full color tiff (it looks exactly like the pdf
file). From my understanding, I should have gotten a 1-bit, black and white
image. What went wrong? Did I read into this too much, or am I not saving it
with CCITT Fax Group 3 compression?
Thanks,
Ben
http://www.shayufilms.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.