NSViews that are scaled (-1,-1) to (1,1) do not print well
NSViews that are scaled (-1,-1) to (1,1) do not print well
- Subject: NSViews that are scaled (-1,-1) to (1,1) do not print well
- From: "Simson Garfinkel" <email@hidden>
- Date: Sat, 22 Dec 2001 00:30:56 -0500
Anybody familiar with my NeXTSTEP Programming book will recall that many of
the examples have an NSView that is scaled (-1,-1) to (1,1).
Turns out that this doesn't work well on OSX. Specifically:
* PDF generation doesn't work well at all. You get a 1 pixel PDF that
represents the area (0,0) to (1,1)
* EPS generation doesn't work well either. You get an EPS that has all of
the data inside, but which doesn't print properly on a PostScript printer
and is not readable by Adobe Illustrator on Windows. (Haven't checked it ont
he Mac version yet.)
Locking focus on an NSImage doesn't work either. Once again, it tries to
make the 1-pixel Image (0,0) to (1,1).
This is all tremendously discouraging, becuase this worked just fine under
NeXTSTEP with Display PostScript. I do not want to introduce ugly scaling
into my NSView subclass when this is handeled automatically by NSView, but
it really seems that Apple hasn't thought out all of the ramifications of
the whole EPS->PDF transition.
My current work-around is to put the whole thing into an NSScrollView and
then to ask the ClipView to generate the PDF/EPS/TIFF from that, but that's
ugly and it doesn't work properly *either*. And it doesn't work properly in
a very weird way --- a way which makes me think that there's some kind of
bug at work.