Re: Getting PDF and/or EPS data
Re: Getting PDF and/or EPS data
- Subject: Re: Getting PDF and/or EPS data
- From: Scott Thompson <email@hidden>
- Date: Fri, 16 Apr 2004 07:35:44 -0500
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.
This is consistent with the PostScript language. PostScript does not
support transparency except through the alpha channel on images. Later
versions of the PDF spec make some concessions for transparency, but by
in large the way that that support is carried out is very
implementation dependent.
If you look at Adobe Illustrator's support of transparency you'll find
that, by-in-large, the way Illustrator implements that transparency
(particularly when putting out PostScript) is by using high-resolution
bitmaps. Macromedia FreeHand can generate full-resolution
transparency, but I have in-depth, first-hand knowlege of how that is
done and it is pretty complex. Essentially it simulates transparency
by duplicating PostScript elements, color tinting them, and drawing
them through a clipping path in such a way that the end result looks
like alpha compositing but is really just painter's algorithm. .
In the PDF case, your use of shadows is probably shooting you in the
foot. What is likely happening is that the Shadow is implemented as a
bitmap. When the system tries to render the items that the shadow
touches it converts those items in turn to bitmap representations. You
might get better results if you can find a way to render the shadow (by
itself) into a bitmap and then use NSImage to composite the shadow into
the view yourself.
Depending on how you are looking at the EPS representation you could
also be seeing the bitmap preview that is associated with the
PostScript code.
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.
This is really not supported by the underlying file format
specifications. They are doing the best they can.
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?
What you're doing "wrong" is trying to use a data format that really
doesn't support the operations you want to store. If you really want a
representation of "exactly what I see in my view" then just capture a
bitmap image of the view and be done with it. :-)
_______________________________________________
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.