Converting TIFF to multipage pdf
Converting TIFF to multipage pdf
- Subject: Converting TIFF to multipage pdf
- From: Ben Mackin <email@hidden>
- Date: Sat, 13 Jul 2002 11:39:13 -0700
My problem is that, say I have 3 tiff files I want to put into one multipage
pdf. I run through the following code, and it puts it into a 1 page pdf file
(the 1 page is just as tall as the 3 pages added up). Not what I wanted. If
any one has an idea on how to get the pdf file to come out as multiple
pages, please let me know. I am guessing that I wont be able to use the
dataWithPDFInsideRect, but who knows.
numPages = [mergeArray count];
myImageToSave = [[NSImage alloc] initWithSize:NSMakeSize(612,
numPages*792)];
while(i<numOfPages)
{
tempString = @"/tmp/receive/";
tempString2 = [tempString stringByAppendingString:[mergeArray
objectAtIndex:numOfPages-i]];
myPDF = [[NSImage alloc] initWithContentsOfFile:tempString2];
[myImageToSave lockFocus];
[myPDF compositeToPoint:NSMakePoint(0, 792*(i+1))
operation:NSCompositeCopy];
[myImageToSave unlockFocus];
i++;
}
myHeight = 792*numOfPages;
kUSLetterSize = NSMakeSize(612, myHeight);
[tempWindow setContentSize:kUSLetterSize];
[tempImageView setImage:myImageToSave];
tempString = [[[NSUserDefaults standardUserDefaults]
objectForKey:@"recieve"] stringByExpandingTildeInPath];
tempString2 = [ tempString stringByAppendingString:@"/" ];
tempString3 = [ tempString2 stringByAppendingString:@"ReceivedFile.pdf"];
myRect = [tempImageView bounds];
data = [tempImageView dataWithPDFInsideRect:myRect];
[data writeToFile:tempString3 atomically:YES];
Thanks,
Ben
_______________________________________________
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.