• 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
Re: Create a PDFPage instance from Quartz-format image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create a PDFPage instance from Quartz-format image


  • Subject: Re: Create a PDFPage instance from Quartz-format image
  • From: John Calhoun <email@hidden>
  • Date: Mon, 3 Mar 2008 11:41:27 -0800

On Mar 3, 2008, at 3:06 PM, Scott.D.R wrote:
However, I want to know whether it is possible to create the PDFPage instance directly from the CGImage, CIImage and so on?

Yes. The best way to be sure is to subclass PDFPage.

Your subclass should implement -[drawWithBox:] and -[boundsForBox:]. Other methods you may want to subclass are optional (an init method for example so you have a hook to set up your unique instance variables).

Your bounds method needs to return the bounds for the page in points for the given box passed in (likely you can return the same bounds for all boxes).

And it is in your draw method that you draw your PDF content in "page space" (that is, assume 1 pixel equals one point — you need not scale or rotate since the viewer - PDFView for example - will be applying the needed transform).

Want to make your PDFPage CGImage backed? Draw the CGImage in your draw method. It's that simple.

There is a sample app or two floating around somewhere that illustrate this: PDFCalendar and PDF Watermarker I believe.

John Calhoun—_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Create a PDFPage instance from Quartz-format image (From: "Scott.D.R" <email@hidden>)

  • Prev by Date: Re: Interface Builder (almost) supports NSToolbar
  • Next by Date: Re: Relaunching an application
  • Previous by thread: Create a PDFPage instance from Quartz-format image
  • Next by thread: Using NSPredicate to parse strings
  • Index(es):
    • Date
    • Thread