• 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 14:26:57 +0200

Antonio Nunes wrote:
On 2 Oct 2006, at 11:48, Fabio Mancinelli wrote:

I haven't found in the PDFPage class any instance method that could be used to draw somewhere the page. There is this drawWithBox method but it doesn't take any "destination".

Yes, that's what you need to have the page drawn. There is indeed no way of specifying coordinates for where to draw, hence the need to use an affine transform to transform the graphics context's transformation matrix so that the PDFPage appears at the right place and at the desired size. I suggest you read up on the use of coordinate systems and transforms.



Antonio thank you.
Actually I have realized that was a misunderstanding of how things work that prevented me to see that it was very simple to do what I wanted to do:


NSAffineTransform* xform = [NSAffineTransform transform];
[xform scaleXBy:2.0 yBy:1.5];
[xform concat];
[currentPage drawWithBox:kPDFDisplayBoxMediaBox];

And here it is! (Of course scaling factors are just for testing purposes :))

Anyway there is something that I am still missing.
concat, drawWithBox (and even, for example NSColor's set) do not take any explicit parameter regarding the "target" of their actions.


I would have expected to have something like

[destination apply:xform]
[currentPage drawTo:destination drawWithBox:kPDFDisplayBoxMediaBox];

but it seems that this "destination" is implicit and "automatically" recognized by the methods.

This is something strange to me. And in the the documentation is not clearly explained.

Thank you 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


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>)
 >Re: PDFDocument and PDFPage (From: Antonio Nunes <email@hidden>)
 >Re: PDFDocument and PDFPage (From: Fabio Mancinelli <email@hidden>)
 >Re: PDFDocument and PDFPage (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: PDFDocument and PDFPage
  • Next by Date: NSBorderlessWindowMask - shadows not working correctly
  • Previous by thread: Re: PDFDocument and PDFPage
  • Next by thread: Re: PDFDocument and PDFPage
  • Index(es):
    • Date
    • Thread