PreviousNextTracker indexSee it online !

(76/161) 2925843 - Colorized copy RTF to Clipboard (IText plugin?)

From Microsoft Dev Studio, it is possible to copy to clipboard selected text, and paste it into other MS apps which recognize that particular MIME type, such as MS-Word.
This means it is possible to copy/paste colorized text.
I'm pretty sure all that is needed is to determine what is the MIME-type and mime-format used to store colorized text from ms-dev studio and mimic it from jEdit, using the colors from jedit's syntax.

Submitted ezust - 2010-01-04 - 20:49:58z Assigned nobody
Priority 5 Category None
Status Open Group None
Resolution None Visibility No


2010-02-18 - 03:23:40z
It turns out the mime-type is HTML.

So basically this is just something that currently requires a 2 steps in Code2HTML - convert to HTML, copy to clipboard.

If there was a way for code2html to add the extra HTML to the list of supported mimetypes whenever text is copied to the clipboard and actually set the mime-type to HTML, then we could paste colorized text into other applications from jEdit.

Can we make it so Code2HTML offers an alternate "copy to clipboard" action that takes the regular text and copies it like usual, but then converts it to HTML and offers the HTML as a second mimetype?

2010-02-18 - 03:34:02z
Something to think about: when we copy/paste from within jEdit, if we have one of these multiple format mimedata available, it should ignore the HTML and paste the text version back. Then the new action could be used instead of the built-in one, as it currently works in MS Dev Studio.

2010-02-18 - 07:16:10z
OpenOffice can also be used to paste colorized text into, not just MS-office. So this is not a microsoft-specific feature.

I want to be able to copy text from jEdit and paste it colorized into OpenOffice Impress.

2010-02-18 - 08:08:04z
I think it is done using TransferHandler and dataflavor.
I suppose that when code2html is installed it could add a new html dataflavor and when we copy some text it would handle the case when the received ask for this flavor.
But it would probably require some changes in the core. I can take a look at that
2010-03-20 - 00:01:28z
the feature is related with that one
I think both should be developped together
2010-04-13 - 15:59:47z
I was mistaken, it is not copying HTML into the clipboard, it is copying RTF into the clipboard.
So we need to convert to colorized RTF, add that as an alternate data flavor.
Perhaps we can do that from HTML or perhaps it is better to do it directly, but this might not be part of the code2HTML plugin.

2010-04-14 - 00:56:08z
RTF Specification:
2010-04-14 - 05:36:22z
Here are instructions for converting from HTML to RTF using the itext library.
2010-04-16 - 11:32:41z
I have a problem here, the RTF part is an extension to iText because iText is a PDF library and I'm unable to find where I can get this RTF extension