Getting PDF and/or EPS data
Getting PDF and/or EPS data
- Subject: Getting PDF and/or EPS data
- From: Steve Sims <email@hidden>
- Date: Thu, 15 Apr 2004 18:38:31 -0400
Hi gang,
So I have a view into which I'm drawing a load of stuff, and I'd like
to be able to save it and also allow the graphics to be copied. Having
consulted the docs I found that NSView has some calls which would help
with this, namely dataWithPDFInsideRect, dataWithEPSInsideRect,
writePDFInsideRect:toPasteboard:, and writeEPSInsideRect:toPasteboard:
Right now I can save out PDF and EPS files using the above calls,
however neither fully matches the output I see in my window. I use
NSImage with an NSCustomImageRep in my view to render some bezier
paths, making use of the compositing routines for masking purposes.
I'm drawing and filling some things with transparent colours, and I'm
also using NSShadow to get a shadow drawn.
When I try to view my PDF inside Preview the compositing operations I
have used are not obeyed. The EPS version does seem to obey the
compositing, so my transparent shapes get drawn correctly, but the
shadow is missing. In both cases composited elements seem to get
rendered as bitmaps.
Obviously what I really want is output that's the same as my window
display but in EPS or PDF format, with no bitmapping of my composited
elements.
The only relevant hint I found for potentially sorting out the
compositing problem was using the NSImage setDataRetained call, but
this does not seem to have had an effect.
Additionally using the writePDF... or writeEPS... calls giving the
pasteboard as [NSPasteboard generalPasteboard] also doesn't seem to
result in anything new being put on the clipboard at all. My copy code
is definitely being called, and the rect seems right...
Does anybody have any hints as to how I might be able to sort this lot
out or ideas as to what I might be doing wrong?
Cheers,
Steve
_______________________________________________
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.