• 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: PDFDocument and PDFPage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDFDocument and PDFPage


  • Subject: Re: PDFDocument and PDFPage
  • From: Antonio Nunes <email@hidden>
  • Date: Mon, 2 Oct 2006 11:12:46 +0100

On 2 Oct 2006, at 09:51, Fabio Mancinelli wrote:

I already do the trick of setSize + setScalesWhenResized but it doesn't work well. The NSImage generated from the PDFPage, when scaled down lose its quality, and when rescaled up becomes unreadable (because it is the low quality image that is rescaled)

To retain the original quality of the image use its setDataRetained method with a value of YES before scaling it the first time, e.g. immediately after creating the NSImage object.


Moreover, my question was raised because of the render quality. Instead of scaling the NSImage after the conversion from the PDFPage (images are pixel based), I would like to scale the PDFPage before because I guess that in this way I can preserve the quality of the rendering of the PDFPage (that is not pixel based and scales well), generating an NSImage already at the right size.

I am not aware of a way to directly scale a PDFPage. You can scale the drawing of the page, as I wrote previously, by using an NSAffine transform. I suppose you could render the PDF offscreen and grab that representation into an image. Others may be able to provide a better solution to this.


Basically I would like to mimic some of the behaviors of PDFView (zoom in/zoom out) but I don't want to use it because I would like to apply Quartz transitions between the page switches.

Is there a particular reason you can't just render the PDF directly to your view? The project I'm working on doesn't use PDFView either: it uses transforms to size and place the PDFPages in the view.


HTH,
António

-----------------------------------------------------------
And could you keep your heart in wonder
at the daily miracles of your life,
your pain would not seem less wondrous
than your joy.

--Kahlil Gibran
-----------------------------------------------------------



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: PDFDocument and PDFPage
      • From: Fabio Mancinelli <email@hidden>
References: 
 >PDFDocument and PDFPage (From: Fabio Mancinelli <email@hidden>)
 >Re: PDFDocument and PDFPage (From: Antonio Nunes <email@hidden>)
 >Re: PDFDocument and PDFPage (From: Antonio Nunes <email@hidden>)
 >Re: PDFDocument and PDFPage (From: Fabio Mancinelli <email@hidden>)

  • Prev by Date: Re: Reading custom rtf attributes
  • Next by Date: Re: PDFDocument and PDFPage
  • Previous by thread: Re: PDFDocument and PDFPage
  • Next by thread: Re: PDFDocument and PDFPage
  • Index(es):
    • Date
    • Thread