Copy To Word

Hi,
We are looking for ways to copy (copyToClipboard) in JBO and paste it into word document.
we were using the copyToClipboard API - and it did not work (nothing on the clipboard)
Can someone send an example how to do it right?
Thanks
Asaf Lahav

I believe one way of doing this is to override JGoView.copyToClipboard to set the Clipboard contents to a Transferable that handles the DataFlavor.imageFlavor data format. You’ll need to define a method on JGoView that produces a BufferedImage, in the same manner that other methods in JGoView do, or that the JPEGView example class does.
For the Transferable class, you could subclass JGoDocument to override the Transferable methods to additionally handle the DataFlavor.imageFlavor case. Or you could define your own class to implement Transferable, most conveniently your JGoView subclass itself.
I haven’t been able to find any code lying around that does this. But I know some customers have done this before.

Walter,

Have the default data flavors been improved in JGO since this post in 2005? I seem to have read in the GO forums that there is a default bitmap dataflavor that gets copied to the clipboard (in addition to text and the JGO document special flavor).
I am having trouble getting an image dataflavor into the system clipboard. I have output images to a file stream using JPEGView. But for the clipboard I wasnt sure how to generate the TransferData for an image based on the code in that class alone.
Any examples out there of copying and image to the system clipboard?
Thanks,
Bryan

There haven’t been any changes to the supported data flavors since the earlier post. The default behavior allows cut and paste between different JGo instances, but does not place any image data flavors on the clipboard. The advice above should still work though.