• 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 any image to PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting any image to PDF


  • Subject: Converting any image to PDF
  • From: email@hidden
  • Date: Fri, 13 Sep 2002 10:55:03 -0700

I need to get PDF data for any image that someone may hand me. I've tried the following "hackish" code to do this by way of the NSView API, but seem to always end up with a PDF of 0 width/height.

imageSize = [image size];
iView = [[[NSImageView alloc] init] autorelease];
[iView setImage:image];
[iView setImageScaling:NSScaleNone];
[iView setBounds:NSMakeRect(0,0,imageSize.width,imageSize.height)];
pdfData = [iView dataWithPDFInsideRect:[iView bounds]];

The use of and NSImageView (iView) here is a total hack as I'm not actually displaying the image anywhere, I just thought it was a good starting point. Can someone please tell me how best to go about this on-the-fly conversion?

Thanks,
- Eric
_______________________________________________
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.

  • Prev by Date: Re: mail.app plug-in API's
  • Next by Date: An observation about executing AppleScripts from within Cocoa
  • Previous by thread: Re: Copy/paste multiple table rows
  • Next by thread: An observation about executing AppleScripts from within Cocoa
  • Index(es):
    • Date
    • Thread