Re: Paste or Drag PDF Data into NSTextView
Re: Paste or Drag PDF Data into NSTextView
- Subject: Re: Paste or Drag PDF Data into NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Tue, 25 Mar 2003 11:24:59 -0800
On Saturday, March 22, 2003, at 11:18 AM, Jeff LaMarche wrote:
I have a program that exports PDF data, places PDF data on the
pasteboard and drag pasteboard. A user recently pointed out that you
get different behavior in TextEdit if you paste/drag the data into
TextEdit or if you export to a PDF file and then import it into text
edit. In the former cases, TextEdit seems to rasterize the data at
72dpi; in the latter, it preserves the resolution independence of the
pdf data.
I have failed to find anything on my end that I can do to change this
behavior, and looking through the TextEdit source code, I failed to
find any code that handles this behavior. Does that mean that this is
stock App Kit functionality? Anyone know why the discrepancy in the
behavior, and if there's anything that can easily be done either to my
application or to TextEdit that would preserve the vector data and
prevent the rasterization?
From your description, I would say that what you are seeing here is the
difference between importing files and importing images in the text
system. When the text system imports a file (pasting or dragging in
with the pasteboard containing NSFilenamesPboardType) the file is
imported as-is, and a suitable attachment is created to represent it.
When the text system imports an image (pasteboard containing an image
type) then the text system simply receives an NSImage, and is forced to
create a file to represent it, by whatever means it can. While it
probably should (and probably will in the future) do a better job at
creating these files, in general you will not have complete control
over the file it creates in this case. The text system will probably
always choose from a limited set of file formats when it creates a file
to represent an image.
Douglas Davidson
_______________________________________________
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.