Re: Issue with dataWithPDFInsideRect:
Re: Issue with dataWithPDFInsideRect:
- Subject: Re: Issue with dataWithPDFInsideRect:
- From: Brock Brandenberg <email@hidden>
- Date: Thu, 23 May 2002 10:24:40 -0500
Hi.
I recently picked up the new O'Reilly book "Building Cocoa Applications"
by Garfinkle and Mahoney,
and it has a paragraph about problems using dataWithPDFInsideRect: on
views not scaled in screen coordinates that confirms this problem that I
have seen.
From "Producing PDFs from NSView" on page 523 of "Building Cocoa
Applications":
"...Just send a dataWithEPSInsideRect: message, and the NSView will
return an NSData object that contains the EPS file. Similarly,
dataWithPDFInsideRect: will return an NSData object that contains a PDF
file...
Unfortunately, in Mac OS X Version 10.0, these methods do not work
properly for views that are not scaled in screen coordinates. Although
these bugs may be fixed in a future release, in order to make this
demonstration program work with Version 10.1, we were forced to find a
workaround."
In essence, they retained then removed the zoomed view from the window,
placed it into an offscreen window at 100%, generated the PDF, then put
it back into the onscreen window (for the newbies, this entails using
setContentView: for windows, and setDocumentView: for clip views inside
scroll views). My solution was similar in that I opted to change the
zoom scale of the onscreen window temporarily to 100%, generate the PDF,
then set the zoom back to what it was. Since this all happened before
any view refresh was possible, it was invisible to the user.
"Building Cocoa Applications" is a very good book, so if you have Aaron
Hillegass' book and don't have this one yet, go get a copy of it because
they're very complimentary. There is repetitive beginner material, but
"Building Cocoa Applications" really dissects its tutorial apps and has
some very good conceptual overviews that fill in a lot of details that
the other current Cocoa books leave out.
I just wanted to post this as a "temporary" closure on the issue in the
list for others.
Brock Brandenberg
----- industrial design @ bergdesign.com ------
_______________________________________________
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.