RTF Support in RTFEditor/JEditorPane

Hi
Whilst using the RTFEditor to display an RTF file in JEditorPane, I'm find some stuff that doesn't get displayed.
* Simple tables. These just show the text as if they were words typed next to each other.
* Hyperlinks. These do not show up at all even as text
Anyone know if this is normal, or am I likely to be missing something.
Thanks for your help.
Nick.

Hi
Thanks for your response. I was guessing the support was limited from my results.
I've tried searching for alternatives, but there doesn't seem to be much else around.
Since this element of the project is in its early stages, I may just opt for a different format to RTF.
Regards.
Nick.

Similar Messages

  • How to insert hyperlinks in RTF document shown in JEditorPane?

    This is a compound question so bear with me on this one :)
    What I need is to insert an hyperlink in a JEditorPane; Store it as RTF code; Retrieve it; Show it and click on it to go the the destination.
    1) So, first question, is there some method to automatically add the hyperlink and will it be saved in RTF with RTFEditorKit? (I'm actually using AdvancedRTFEditorKit but an answer to either will be enough)
    2) I tried a method that adds what appears as a link but the document that is stored doesn't have the necessary RTF codes, only the formatting that makes it look like a link. I also checked the actual RTF codes I'd need to add and they seem easy to do. So, is there a way to add the actual underlying RTF codes to the document while it's in the JEditorPane?
    I know the question(s) isn't too specific, if you can shed some light over the whole thing and point me in the right direction, it'd be great!

    Just a follow up to my own question. I found a way to answer my question 2) and I'm now storing the rtf code for hyperlinks. Now, when I show the document in JEditorPane with RTFEditorKit, I get the name of the hyperlink with no formatting indicating that it's a hyperlink.
    Example. The link "http://www.google.com" with the name "Google", only shows "Google" in plain text.
    Is it because the components I'm using don't support hyperlinks from RTF files even though they're supported from HTML files?
    Is there any way you can see this working? Is it possible to include something inside the JEditorPane that the user can click, instead of the hyperlink?

  • HTML, RTF Support...

    the tutorial for printing text in the sun swing tutorials said that several file fromats are supported like HTML, RTF etc...could anyone tell me where i can find the tutorial to print in the supported formats???

    If you can 'print a component', make that component a JEditorPane - which understands/renders HTML & RTF.

  • RTF Support

    Post Author: MGervais
    CA Forum: Crystal Reports
    I know that a report can display a string value encoded as RTF, but I am wondering what version of RTF is actually supported.  We have reports that print fields containing RTF tags for printing tables with borders.  None of these tags are being printed correctly.
    I have tried using CR 8.5 and CR XI and get the same result.
    Any ideas?

    Post Author: IdoMillet
    CA Forum: Crystal Reports
    For a description of RTF rendering limitations in Crystal Reports, see:
    http://support.businessobjects.com/library/kbase/articles/c2011504.asp

  • Will RTF support be included in new iCloud for outlook?

    Since it was disabled with iCloud2 I have waited to an update to get these functions available.
    So far it seems nothing changed. Rtf, HTML, fonts... Nothing.... Only plain text.

    As long as your device will be the default device name (Dev1) in every instance the software will use, you should be fine.  If you use a specific configuration other than the default that you set up in MAX, you will want to add MAX to the installer as well as the MAX configuration for that device.
    www.movimed.com - Custom Imaging Solutions

  • This method "setPage(url)" of JEditorPane do not support javascript

    does java have any package to support javascript

    Java that you download from Sun does not support JS in JEditorPanes, no.
    There is a library called Rhino which is a JS implementation for Java. I don't know if there's any way to get JEditorPane to use it. I would suspect not, but check out the Rhino site and they might have that info.

  • JEditorPane and more html support?

    Does anyone know if Sun is planning on expanding the html support of the JEditorPane?

    Recently there was a postin the JavaHelp interest mailing list saying that the Swing team is looking into probably enhancing the text and html package for Java version 1.5...

  • Print RTF file within app

    Hi
    Is it possible to print an rtf file from within java app without actually viewing the file on screen? I don`t want to display the file in a jtextpane or jeditorpane. Simply want to print the file like you can with a straight text file.
    Or, is there are a command line switch to print a rtf file? through ms word?
    Any help would be appreciated.
    Thanks
    Kelly

    printing RTF files from java is amazingly hard. if not impossible.
    (just what you wanted to hear)
    basically, rtf support in java is pathetic.
    in my case, i had to create an actual RTF file in ms word and save it.
    i then opened it in notepad so that i could see all the control codes.
    then i cut and pasted each section of the document template so that each bit was a string constant in java. the bits that i wanted to add i generated in code the normal way.
    then i stuck all the bits back together again in one string and sent that off to a data stream. (to answer your question, it never went to the screen, just to the data stream)
    its a bloody stupid way of doing rtf, but it was the only way to get it to work without having to go through and figure and implement out all the rtf codes yourself.

  • German Special Characters not displayed correctly in RTF  using code

    Hi ,
    In my code we are using webdynpro method
    WDResourceFactory.createResource(
    byte[] data, String resourceName,WDWebResourceType
    Type)
    Here in our code we are implementing this as
    ITemplateElement templateEl = wdContext.currentTemplateElement();
    WDResourceFactory.createResource(
    templateEl.getReportData(),
    reportName.substring(0, reportName.lastIndexOf('.')),
    WDWebResourceType.RTF); reportName.lastIndexOf('.')),
    Here templateEl.getReportData() returns a set of bytes which has some
    german special characters.
    We are generating the Bytes using String.getByes(),Just before
    String text = new String(in);
    collector.putBusinessObject(boName, bo);
    reportDocTemplateParser(collector, text);
    collector.removeBusinessObject(boName);
    String generatedText = collector.generateRTF();
    out = (null != generatedText) ? generatedText.getBytes() : null;
    The out put is the if i am giving a word with german special characters for eg:
    Betriebsübersichten it first gets converted to bytes and then passes through method WDResouseFactory.createResourse(.....) which creates an RTF file and finally in the RTF file it appears as Betriebsbbersichten the special character is not displayed correctly.
    i came to knw that while converting into bytes we have to make it RTF supported encoding.ie for eg generatedText.getBytes('cp1252').i even tried with other charactersets like ISO-8859,cp1253 and so on but none of them worked.
    It would be really great if you could suggest the needful.
    Thanks and Regards
    Neeta

    I soved this by using get_data function of response object. Then converting this into ISO-8859-1 charset.
    See code below.
    DATA :  lv_encoding   TYPE abap_encoding,
              lv_conv       TYPE REF TO cl_abap_conv_in_ce,
              lv_x_string   type xstring.
      lv_x_string = pv_http_client->response->get_data( ).
        lv_encoding = '1100'.
        lv_conv = cl_abap_conv_in_ce=>create(
                              encoding = lv_encoding
                                 input = lv_x_string ).
        lv_conv->read( IMPORTING data = pv_result ).

  • Inserting image in rtf doc

    Hi all,
    i am trying to make my own rtf editor , I've read the most of the toppics in this forum on this issue,
    but I'm stucked on inserting the hex Data into the document.
    Do I actually need to override ImageView?
    I found a method in RTFReader (instantiated from read(InputStream in,...)) handleBinaryBlob(byte[] data).
    RTFReader is private, so I cannot override this method. Should I override the read method in
    RTFEditorKit and then call the read method in DefaultEditorKit, or I could just use the doc.insertString(...) with the binary data inside of the overriden RTFEditorKit read method? I will lose the functionallity of the RTFParser this way.
    I know I should override read and write methods but how?
    So could somebody help me on this?
    The code for creating the binary data from buffered image and creating the Icon from StanislavL follows:
    ImageIcon icon=(ImageIcon)StyleConstants.getIcon(attr);
    if (icon!=null) {
    int w=StyleConstants.getIcon(attr).getIconWidth();
    int h=StyleConstants.getIcon(attr).getIconHeight();
    ByteArrayOutputStream os=new ByteArrayOutputStream();
    PNGCodec p=new PNGCodec();
    ImageEncoder pe=p.createImageEncoder("PNG",os,null);
    BufferedImage bi=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
    bi.getGraphics().drawImage(icon.getImage(),0,0,null);
    pe.encode(bi);
    byte[] ba=os.toByteArray();
    int len=ba.length,i;
    StringBuffer sb=new StringBuffer(len*2);
    for (i=0;i<len;i++) {
    String sByte=Integer.toHexString((int)ba & 0xFF);
    if (sByte.length()<2)
    sb.append('0'+sByte);
    else
    sb.append(sByte);
    String s=sb.toString();
    out.write("{\\pict\\pngblip ");
    out.write(s);
    out.write("}");
    extracting image
    String content; //<- image representation
    int len=content.length();
    //converts to binary representation
    byte[] buf=new byte[len/2];
    for (int j=0; j<len/2 ;j++) {
    String c1=content.substring(j*2,j*2+1);
    String c2=content.substring(j*2+1,j*2+2);
    byte b1=Byte.parseByte(c1,16);
    byte b2=Byte.parseByte(c2,16);
    buf[j]=(byte)(b1*16+b2);
    //creates image from binary
    Image img = Toolkit.getDefaultToolkit().createImage(buf);
    ImageIcon icon=new ImageIcon();
    icon.setImage(img);
    if ((icon.getIconHeight()<0) || (icon.getIconWidth()<0))
    return;
    MutableAttributeSet attr=new SimpleAttributeSet();
    StyleConstants.setIcon(attr,icon);
    //inserts image in the document
    document.insertString(currentOffset," ",attr);
    currentOffset++;
    I guess these two functions must be implied into the overriden EditKit write and read methods.
    Could somebody give me a start idea?
    regards
    rumpi

    Thanks for reply.
    It did't helped me a lot or I'dont really understand your idea.
    What you say in your postings is build my own reader and writer.
    For example to open a rtf file in my jeditorpane I must read from
    the input stream each byte and reimplementing AbstractFilter, RTFParser and RTFReader
    I could get all headers like \par or \pic and then rtfDoc.insertString(pos, "the label content", attr) with the attributes extracted from header.
    When that is the only way I am asking myself what are the swing people for?!?!
    I'll try to do that myself, so I'm not asking for code but I would appreciate
    some detailed info about it. For example when I dont use RTFReader anymore
    I loose everything what I've got untill now. So I should read every byte opening a file
    and check like in RTFParser if the first character is "\", then the next couple of bytes
    untill I get the header. Then I should check which labels(text) is this header for(until the next header), so
    I could insert a string with the according attribute set? For Icon when I get the
    \pic header I read the byte sequence and build the picture just like you wrote.
    My Editor is an applet so I've hoped I wouldn't send too much code to the client
    so reimplementing RTFParser, Reader... would slow it down, but whatever.
    Thats really a lot of work only because the given classes are not extendable, grrrr.
    Viravan, thanks for the fast reply , but like I said , I 've already read all relevant
    postings in this forum and didnt found something really helpful. I already read all
    tutorials and articles from sun about this issue and I still have the feeling I'm a freshman
    in this area.
    I'm still angry with the swing team about it, this bug is noted since 2001 I think. grrr
    regards
    rumpi

  • HTML to RTF Convertor

    I've got a number of HTML formatted datafields that users have entered using the APEX text editors (FCK).
    I would like to integrate those fields with a report but the report if not interpreting the HTML very well. As such I'd actually like to convert the HTML to RTF.
    I see a number of commercial DLL's exist for doing this within end applications.
    I'd prefer to actually do this conversion at the database side - has anyone done anything similar? Or have any suggestions for an approach?
    Thanks,
    Scott

    I'm working with Crystal Reports - the report must be customer quality. And the issue surrounds the fact that Crystal only supports limited HTML tags (see http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2014842&sliceId=&dialogID=9876280&stateId=1%200%209874388)
    But it's RTF support is a lot better, hence the desire to convert the HTML to RTF.

  • How to save Pages document as a rtf?

    How to save Pages document as a rtf? There is no option in the export pull down menu on Pages version 5.1. This is possing to be a big problem as an online couse wants documents saved in this format.

    Pages 5.1 is a buggy, crippled disaster. The lack of RTF support comes under the "crippled" rubric.  It lacks about 100 features present in Pages 09. Beware of the buggy stuff, too: there are many reports of data corruption, of users being unable to open files, etc.  Adivse you use Pages 09, or Word.

  • When does this kind of error come in RTF Editors?

    Hi All
    I am writing an applet based text editor, based on RTF Editorkit, i have got this pecular error when doing executing this statement.
    rtf.read(fileInputStream1,ep.getDocument(),0)
    Where rtf is my RTFEditorKit instance.
    ep is my JTextPane
    and fileInputStream1 is the fileInputStream which i am using
    The above line of code threw me an IOException saying the below
    'Too many close-groups in RTF text'
    I am unable to understand what could be the source of this error, or may be what will trigger this particular error.
    Please help
    Swaraj

    This happen if u got more closing braces than opening braces in your rtf.. RTFeditor Kit calculate level base on braces

  • RTF Editor

    I am scanning a fairly complex document, and then do an OCR to RTF format using Omnipage.
    WordPad is insufficient for editing the resulting RTF file. I have also not been successful in using a word processor, and then saving to RTF format, as certain formatting is often lost.
    I looked up the RTF standards, but it is difficicult to make heads or tails of.
    I can't be the first person that has run into this problem, are there certain Editors that people use for creating more complex file layouts than WordPad can handle, or is there a way to tell which formatting you will lose when you save a file in RTF format from Microsoft Word.

    Hi Lee
    The RTF spec is certainly a subset of the MSWord 'doc' format and other Word processors. Its owned by MS but an open format so its up to the individual processor developers as to how much of the spec they implement. MSWord should have the most comprehensive implementation of course.
    There are differences in what RTF supports compared to 'doc' but I have not seen a document from MS highlighting them.
    Tim

  • HT4641 Is there any way to make .rtf files work?

    I didn't notice the lack of .rtf support when I bought it (urgh!), which would make this app perfect for my needs, as half my files are .rtf and I have to actively convert each file one at a time into doc or docx if I want to use them on my ipad 2, and then back again if I want to upload them to the group that prefers .rtf files. Pain-staking process, that. This simple change would be a great feature for an update.

    What kind of parental controls are you talking about? You have full control over standard accounts on your Mac by using the Parental Controls system preference.
    If you're concerned that a child will try to circumvent the controls by changing the admin password using the installation disk, then you can certainly set an EFI password. Follow these instructions.
    Matt

Maybe you are looking for

  • How to fetch Errors in Workflow E-Mail

    Hi All :-) Just a short Question. We´re using OWB 10.1.0.4.0 and Workflow 2.6.x. Now i try to use the E-Meil Activity in a Workflow. Everything works fine, Mails delivered correct. So far so good... Now i want to fetch the evantually appearing Errors

  • Mail not showing new mail

    Mail is no longer showing new messages when they arrive. I have to go to Take All Accounts Offline and then Take All Accounts Online, and only then to the messages appear in the inbox. I think this started after upgrading to Mavericks. Does anyone kn

  • Any way for iPhoto to NOT launch when iPhone connected?

    Hey gang- Is there any way to configure iPhoto to NOT launch every time my iPhone is connected to my iMac? I understand why it does it- because there are photos on my iPhone Camera roll- I get it. But I would love for it to NOT launch iPhoto every ti

  • Errors integrating ABap system in SLD and PI

    Dears, I need informations about how to include an Abap system to the SLD , installaed on a different machine, and to make it available for the communication with a PI system. It's a silly question but I'm quite confused about the step should be perf

  • Account details on HP live photo

    HP Live Photo Software I have put a wrong Account name on this application.  How do you change the account name?