Problem with dataWithPDFInsideRect
Problem with dataWithPDFInsideRect
- Subject: Problem with dataWithPDFInsideRect
- From: Nicko van Someren <email@hidden>
- Date: Fri, 11 Nov 2005 19:11:14 +0000
Hello Cocoa Folks,
I'm having an odd problem with NSView -dataWithPDFInsideRect: which
I'm using to save a PDF version of an image on screen.
I have a program which attempts to render paths extracted from an
SVG file. It's not a very complete implementation of SVG but it does
the trick for the task in hand. The paths are extracted and turned
into NSBezierPath objects and are displayed in a custom view. The
bounds of the view are set to the bounding rectangle of the set of
paths and the frame is set so that it has the same aspect ratio as
the bounds and so that the larger of the width and the height is 1280
points. This is wrapped up in an NSScrollView and it all works just
fine on screen.
The problem is that when I use dataWithPDFInsideRect: and save the
result to a PDF file the page size for the file is totally wrong.
The paths render just fine, way down in the bottom left corner, and I
have a huge expanse of empty space above and to the right. Upon
closer inspection it turns out that while the rendering of the paths
is done with the correct scaling (e.g. it comes out 1280 points wide)
the size of the page, in points, is the size of the bounds rectangle
in its own internal co-ordinates.
So, the questions to this list are (a) is this a bug and (b) does
anyone know a way around this?
Cheers,
Nicko
_______________________________________________
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