• 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: Fabio Mancinelli <email@hidden>
  • Date: Mon, 02 Oct 2006 10:51:23 +0200

Antonio Nunes wrote:
On 2 Oct 2006, at 08:24, Antonio Nunes wrote:

Now the problem is how to scale the PDFPage so that the created image fit the size of the custom view.

No need to scale the PDFPage object, just use an affine transform when drawing to the custom view to size the image as needed. If you are not familiar with transforms it's easily looked up in the documentation (NSAffineTransform).

Alternatively you can resize the created NSImage object with it's setSize method (and be sure to read up on its setScalesWhenResized method too).


António


Thanks for your answer.
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)


This made me think that the process PDFPage->NSImage->Draw is not the best way to do it, unless you perform the PDFPage->NSImage conversion every time there is a redraw (and I don't know if it is performance-friendly).

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.

Thanks again,
Fabio
_______________________________________________
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: Antonio Nunes <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>)

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