Copy-paste for HTML

Respect,
I have to implement copy-paste feature for HTML content (from JEditorPane).
In my onButtonClick method I used something like this:
JEditorPane doc = contentPanel.getActiveEditorPane( ) ; //my html content
TextTransfer textTransfer = new TextTransfer( ) ;
textTransfer.setClipboardContents( doc.getSelectedText( ) ) ;This works ok only for plain text (i.e. when I try to paste on MS Word, I got plain text).
I need styled text, with all html tags, which MS Word is capable to display.
Can anybody help?
Thanks in advance.

This is code that I can't use any more. Yes, I would maybe need to transfer images too (but not the moment). Now I just need too be able to correctly copy html content (all tags and headers). Is there any other "Transfer class"? Or, could I try to fire event like Ctrl+C? How do I do that?
thanks for your time

Similar Messages

  • How do I disable copy/paste for most (but not all) of a .pdf?

    Hello, I'm trying to create a .pdf document that is a "how-to" guide.  I'd like to disable copy/pasting from 95% of this document, with the exception of a few sections that i'd like my users to be able to copy and paste and use as email templates.  I've gone ahead and set pasword security settings and un-checked the box for "enable copying of text, images, and other content".  Is there any way that I can enable copy/paste for just a few small sections of my document?  or is it an "all or none" function?
    Thanks in advance for your help.  -Geoff

    Graffiti, Can you please expand on that?  I'm using Microsoft Word as my original document.   I'll have mostly paragraphs of non-copyable text, with a few sections that contain sample email templates that will be copyable.  Example below.  Thanks, Geoff
    Here is my description of an amazing new process written in Word.  To use this process, copy the email template below and customize with your own name.
    Email Template
    Dear John,
    Copy this email and send it with your own name.
    Thanks,
    Geoff
    More non-copyable text.

  • Urgently Need Code for Copy & Paste from Html Table in JSP to Excel file

    I am creating a html table in JSP file .
    I need code for 'Cut,Copy,Paste' functions ie. if someone wants to copy data from my table to excel file or from excel file to html table he shud be able to do that.
    Can someone give me code for 'Cut,Copy and Paste' i.e. some javascript functions which can do cut, copy and paste which i can put in my jsp file
    Thanks
    Message was edited by:
    javatechguru2007

    package com.chinmayananda
    public class Tetris{
    // complete here
    code]
    public abstract class AbstractTetris {
       public abstract void start();
       public abstract void stop();
    }nearly done

  • How To set cut/copy/paste for JtextArea

    Hai
    i could not able to set cut copy paste in JTextArea
    pls help me in this filed..
    thanx.

    This will do...... :)
    private Hashtable actionHash = new Hashtable();
    Action ac[]=new Action[3];
    JButton butt[]=new JButton[3];
    int count=0;
    String ac_names[]={DefaultEditorKit.cutAction,DefaultEditorKit.copyAction,DefaultEditorKit.pasteAction};
    Action[] actions = YourTextPane.getActions();
            for (int i=0; i<actions.length; i++)
                String name = (String)actions.getValue (Action.NAME);
    actionHash.put(name, actions[i]);
    for (int i=0; i<actions.length; i++)
    ac[i] = getHashedAction(ac_names[i]);
    butt[i]=new JButton(ac[i]);
    protected Action getHashedAction(String name) {
    return (Action)actionHash.get(name);

  • Copy/paste for tablet

    I'm trying to find the copy/paste keys for the docs function using the onscreen keyboard?
    Solved!
    Go to Solution.

    TexTucker wrote:
    In the open doc, tap and hold over the phrase you want to copy.  Move the pointers to enclose the phrase. Tap copy.  Go to where you want to paste.  Tap and hold in a space then tap paste. 
    And the same will work basically on most all documents, emails, messages, websites and URLs on the PlayBook.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Copy / Paste for the key of a Wifi connection on N...

    Hello,
    It would be great to be able to paste a password for the key of a Wifi network.
    When a key is more than 60 char long and has a lot of special characters, it is really hard to type (with a numeric key because it is not possible to use  the azerty keyboard on this screen).
    Also, to be able to select some text from a Txt file would be great (so I can copy a text file in the memory card of the GSM and then I can paste it
    Is there a way to do it?
    Thank you
    Marc

    Press and hold the 'pencil' icon and at the same time, push the cursor towards the text. You'll be able to see the text being highlighted. Once you've completely highlighted the text, you'll be able to see 2 options on screen: Copy / Paste. Select 'Copy' (with your finger still pressing the 'pencil' button.) Now let go of the pencil button, and press and hold it again, then select 'Paste'
    You can even exit the application that you were in and start a new one and paste your copied text there. The text will still be stored in memory until u either select another text to copy or restart the phone.
    Was this post helpful? If so, please click on the Kudos! star to the right. Thank you!

  • ITunes 10.4.0.80 does not allow copy / paste for album artwork.

    Only importing picture now works.  Any one else having this problem?

    Have you tried to drag & drop artwork instead of copy & paste? It seems to work just fine too.
    The only issue I've faced with album artwork is what turingtest2 has mentioned, which is hardly an issue for me since I use MP3tag to edit ID3 metadata.
    Hope that helps,

  • Acrobat 9 PRO windows help.. copy paste for dummy

    Help...please
    I open pdf documents, highlight the text, copy and paste into MS Word or other programs and the text spacing is all messed up. There are spaces between letters in words. How do I paste, copy or whatever? I want the copied pdf to look exactly the same in the created file that it is pasted into. If you can help, I'll need detailed instructions, my expertise is not computer stuff.
    Very specifically, I'm a student and am allowed to convert lessons and lectures from text to voice to listen instead of reading all day. The NaturalSpeaker program works great on Word documents, email, and everything except pdf files. It will work on them too ifI remove the thousands of spaces that appear after pasting in the program or a word document.
    Thanks.

    Hi,
    You are in something of pickle.
    Not due to you or Acrobat.
    Unfortunately, whomever provides the PDFs you are using appears to have failed to deliver a well-formed Tagged PDF from an appropriate authoring application having adequate tag management.
    Tagged PDF is, by design (see ISO 32000-1), capable of supporting use of assistive technology applications, export of content (copy-paste is a sub-set of this) to Word (with layout - format- font info retained/provide), and reflow on mobile devices (tablets, smart phones, eBook readers).
    Of course, the AT application authors have to hold up their end by releasing applications that behave properly with regards to the ISO Standard.
    As PDF is very much a different format than that of a word processor the "copy-paste" of content does not behave in the manner we are all familiar with when doing this with a word processor file format.
    Acrobat X provides a much more robust export to MS Word of untagged PDF content than that provided by previous versions.
    Regardless, a well-formed Tagged PDF is usable by AT and Adobe Reader.
    Lacking a "proper" PDF you could use Acrobat Pro 9 to add tags to the PDFs.
    Then, export to Word or RTF.
    Or, save as to accessible text.
    Work this over with Word.
    Be well...

  • Since updating can no longer use copy/paste for copying internet material into my Word documents

    There was a recent update on Fox which I automatically downloaded. Now when I attempt to copy select material or articles I find online the usual copy/paste functions no longer work when I try to copy into already established or new Word documents

    I have the same problem.
    All of a sudden, I can't drag or cut&paste anything from the Character Viewer into my word documents.
    I think it changed when I upgraded to Mavericks.
    I get the circle with the line through it when I try.
    I hope that someone reads this and has pity!
    thanks

  • Copy/Paste for Network Password

    This is just a small annoyance that I has bugged me. In the dialog box that comes up when you have no preferred networks available, it asks which network you would like to use instead. Then, if you pick a network with an encryption, a field for "Password" appears. In the past with Tiger, you could copy and paste a password into the equivalent field in the equivalent dialog. But now, it won't let me copy the password from an rtf file into that field.
    It's a minor difference, but I hope Apple can change this back to the way it used to behave. I don't see why it would be important to stop a user from pasting.
    Message was edited by: Ankur

    Sounds like Apple is trying to enforce better security practices. This is also true with the login window so I suspect this functionality will remain the same.
    If the password is readily available in an rtf file on your computer, why have a password for the network at all? Worse yet, if any outsiders know this, they'll target your computer in order to get other passwords. Major security breaches can be caused by combining multiple escalations of privileges. At the very least, I recommend against discussing your security procedures with anyone who doesn't need to know.

  • Copy&paste from Html page

    Hello!
    I want to write a programm that selects text on an hmtl-page,(not in the source) then copy the text, so that i can use the string i get.
    Is that posssible?

    If the text is an image, then you cannot cut and paste the text programmatically.
    However there are some sites that use Javascript to write out text to the page. If this is the case, you should be able to get the text. Look around, the text should be visible somewhere in the source.
    What you could try is:
    Make an HTTPUrlConnection to the site ex. http://www.somesite.com/somepage.htm
    Get the input stream of the connection and read the data.
    Check if the data that you get (input) has the text that you need. If it does, good! else, you will have to look for another solution.
    URL u = new URL("http://www.somesite.com/somepage.htm");
    DataInputStream dis = new DataInputStream(u.openConnection().getInputStream());
    StringBuffer input = new StringBuffer();
    String inline = null;
    while ((inline = dis.readLine()) != null)
         input.append(inline + "\n");
    dis.close();

  • Avoiding copy-paste for common "look" in JSPs

    I'm sure this is a solved problem, I just don't know where to look.
    I have two JSPs, one for search and one for search results. Both have
    the same "look" - a banner at the top, navigation controls on the
    left, and content in the middle. The banner, controls, and content are
    different for each page. I would prefer to keep separate JSPs for each
    page.
    Since the "look" of the pages are identical, I'd like that information
    to only live in one place. I can't do a <jsp:include> for the "look"
    information, because then I can't put content-specifc information on
    the individual page. Is there any way to do this without copying
    the "look" code into each JSP?
    Thanks!

    Hi,
    To my knowledge CVDP (Composite View Design Pattern ) may help out at these kinds of problems..
    Thanks,
    ykr

  • Logo fading when copy/pasting for no reason

    Hello, please look at http://www.bellwoodbnb.ca/1.html The logo on the left (un faded is correct)
    My logo on the file that i created it in looks perfect. When i create a new, blank AI file and paste it into it, it pastes as a faded version of my logo. I have gone through all the settings i could find between my two files and made them identical, it still happens. When i paste the logo into the same file it was created in it pastes correctly.
    Anyone have any ideas as to what's going on?
    Thanks in advance!

    Replace the Pantone Plus libraries as described here:
    http://helpx.adobe.com/illustrator/kb/pantone-plus.html#main-pars_text_11
    At the moment printing this job in offset could get kind of expensive with all these Pantone spot colors. You need to convert the spot colors (Pantone) to process. Please see the manual on how to handle print color in general and swatches in Illustrator in particular.
    http://help.adobe.com/en_US/illustrator/cs/using/WS714a382cdf7d304e7e07d0100196cbc5f-6284a .html

  • What is available to read write copy paste for word documents?

    Need an office document program compatible with ms word.......suggestions please.....

    Need an office document program compatible with ms word.......suggestions please.....

  • Bulk / Collection copy/paste in Workbench 3.1.2

    I have a use case that would benefit from having a copy/paste function at the Collection level.  Either copy an entire collection to a new collection or select many items from within a collection to copy/paste into another collection.
    I know there the copy/paste for single items but with hundreds of items, this method not viable.
    Thanks

    I was able to get the thesaurus working by just adding the entries in the Workbench. There was a problem with the IFCR Utility which was the reason why the Thesaurus entries were not being published to the Live Dgraphs. Once that was fixed, the thesaurus worked correctly.
    But Keyword Redirects had more effort as our site was using presentation API. The keyword directs configured in the workbench are not being returned as Supplement Objects, but rather as a content XML. So we needed to handle the XML content which contains the redirect url.
    If you have set up your application correctly, then you should be able to see the redirects in jspref atleast.

Maybe you are looking for