Hi, I am trying to work out an issue with some text editing and drawing.

I paste a PDF image file into some text that is being edited using a text view, 
and as expected, the text storage gets a text attachment with an image with a 
PDF image rep passed to it. Then by the time it gets to 
textStorageWillProcessEditing, the image is the same but the PDF rep has been 
swapped out and an NSCGImageSnapshotRep has been substituted. I presume it is 
caching it as a bitmap for drawing performance reasons.

For some reason, when I try to draw this text using 
drawGlyphsForGlyphRange:atPoint:, these images are being drawn upside down 
(while editing in a text view, they appear the right way up). Even if I go 
through all the images in the text and turn on setFlipped, it makes no 
difference - they still draw upside down.

When I save the file and load it again, it loads the PDF images and they draw 
the right way up. This only seems to happen with PDF images - other formats 
work fine (I do need to flip them seeing as I am working in a flipped 
coordinate system when I draw the string).

It seems that I need to either avoid them being turned into the snapshot rep, 
or replace the rep with the PDF rep or something to be able to work around this 
problem.

Has anyone else encountered these problems? Any suggestions on a good approach?

Thanks

Gideon_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to