• 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
Converting TIFF to multipage pdf
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Converting TIFF to multipage pdf
      • From: Jeff LaMarche <email@hidden>
References: 
 >Re: how to hide/show/bring to front apps with Cocoa? (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: how to hide/show/bring to front apps with Cocoa?
  • Next by Date: Re: NSFormatter problem when dialog box closed
  • Previous by thread: Re: how to hide/show/bring to front apps with Cocoa?
  • Next by thread: Re: Converting TIFF to multipage pdf
  • Index(es):
    • Date
    • Thread