Display Word-document in TextPane ?

Is it possible to display a word-document in a JTextPane ?
If yes,how can it be done ?
thanx.

You have to code a class that parses a Word doc file,
and then returns the text and the attributes that the
TextPane supports (which I think is only text).Hi,
you can have all the styles in a JTextPane the Class StyleConstants supports if you use a DefaultStyledDocument it it and setup the styles in a SimpleAttributeSet with the methods of class StyleConstants. To insert styled text in the JTextPane use the insertString(...)-method of it - there you can pass string and SimpleAttributeSet.
You can use this styles during editing too by the setParagraphAttributes(..)-methode resp. the setCharacterAttributes(...)-method.
greetings Marsian

Similar Messages

  • How to display word document as a HTML document in portal

    Hi
    I developed a portal application in that i am displaying word document using IFrames, from my application i am uploading word document and saving those document in KM
    Requirement is that i need to provide an option to show this word document in html.
    Thanks
    Rudradev.

    Hi Glenn Mendonca
    I thing it is possible
    Even in SDN search results page, we have option called "HTML version" link
    to see the search document in HTML
    see the below url
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2fforums%2fsdn_forums%2fthread%7b74687265616449443d39313633%7d.jspa
    i hope passing doucment as a query parameter to com.sap.km.cm.highlightedcontent?DocumentUri=
    might solve this
    pls give your inputs
    Thanks

  • Display Word Document as read only in VI pannel

    In a VI pannel I put an Active X container with the IE browser to display Word documents.
    The document are displayed properly but I want not give the user the possibility to make changes while viewing.
    Is there a solution to do so?
    (The documents are read-only and can not be saved.)

    Why use an IE container to display Word documents? You can place a word document directly in the ActiveX container. This seems a better choice.
    If you wish to totally block user-input, you can place a transparent picture control over the display of the Word document.
    Another alternative would be to convert the word document to a PDF and show this in an AcviteX container.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Displaying Word documents on web using IFS

    I am trying to display word documents stored in IFS on the web using the IFS Java API. The process we are currently using is outlined as follows :
    1. Connect to IFS using the connect() method of LibraryService class.
    2. Obtain references to IfsFileSystem object and PublicObject (using findPublicObjectbyPath() method of IfFileSystem class).
    3. Cast the PublicObject to Document class.
    4. Obtain a reference to the InputStream using the getContentStream() method of Document class.
    Now, how do we display the contents of this document on the web ? Is there any IFS classes that do this for us or do we have to rely on the Java I/O classes to read the InputStream char-by-char and display the file ?
    Thanks

    If you are trying to retrieve binary content through a customer Web client, you wouldn't write it to the browser - since the browser can only display HTML.
    Instead, you would generate a Web page which includes a URL to the document (e.g. http://ifsserver/:81466, or http://ifsserver/public/mydoc.doc). Subsequently, when a user clicks the URL, the browser will request the document directly from Oracle iFS' http server. When the http protocol server returns the document content, the browser will determine its MIME type, and launch the appropriate viewing application or helper application automatically.
    null

  • Displaying Word Document from a Database

    Let me try to explain this.
    I can upload and store a Word Document in an Oracle database
    (BLOB column) but now I need to extract that Word document and
    place a pointer to it on the Web. Can someone explain to me how
    this is done?
    I'm trying to do something like have an image displayed on
    the Web and when you click on it the Word Document is opened.
    Follow me on that? So, if there are 15 Word documents in the
    database, then the web page would have 15 images all pointing to
    each separate Word document.
    Has anyone done this?

    Don't take my word on this, but I think this should work;
    I've done this in the past to send dynamically-generated CSV files
    to the user, which is in a way (at least at the perspective of
    what's being outputted to the user) the same thing.
    First, obviously, you need to retrieve the Word document data
    from the database. We'll say you put that in a variable called
    'wordDoc'.
    <cfset wordDoc = someQuery.wordDataObj />
    Next, we need to set the 'Content-disposition' HTTP header,
    to tell the client's browser that we're sending a file, and that we
    want you to call it somefile.doc by default. We'll do this with the
    <cfheader> tag (note that if you use <cfflush> in the
    application, this tag (and thus, this approach)
    will not work.
    <cfheader name="Content-disposition" value="attachment;
    filename=somefile.doc" />
    Almost there. Now we need to set the Content-type HTTP
    header, to tell the browser what kind of data is coming, and then
    give it the actual file data. We'll use the <cfcontent> tag
    to do both of these things.
    <cfcontent type="application/msword"
    reset="yes">#wordDoc#</cfcontent><cfabort>
    If memory serves, this should be all you need. Note the
    <cfabort> after the closing <cfcontent> tag, I've had
    problems in the past with additional output on the page after these
    tags being appended to what gets sent to the browser, so I use a
    <cfabort> afterwards to make sure nothing more gets sent
    after the data we want. Also, at least with CFMX7, I've noticed
    that debugging output tends to get added in too regardless, so I
    typically put a <cfsetting showdebugoutput="false" /> at the
    top of the file, too.
    I can't guarantee this will work, I haven't tested this
    particular situation, but if it doesn't, it ought to be close. Let
    me know if I'm wrong.
    Attached is what should be the code without my commentary /
    rambling interspersed.

  • Upload and display Word Document in WD application

    Hello,
    I have a WD ABAP appl. where the user wants to upload an Word / Excel file (from its own local drive).
    The document shall be saved in SAP and it shall also be possible to display the document later in the WD application.
    I implemented the UI element upload in the view, to determine the path of the document.
    For the display implemented the UI element Office control.
    1. When i browse the document, the properties data, filename and mime type are filled into the bound context elements of the upload UI.
    2. The property datasource of the UI office control I bound to the same context element, that is also bound to the property data of the upload UI.
    The office control opens a word document, but the document is empty.
    Is it possible that the document is not uploaded correct?
    In another application I did an upload for a PDF doc.. There I implemented the following coding as action of the button 'Upload'.
    data lo_nd_pdf type ref to if_wd_context_node.
    data lo_el_pdf type ref to if_wd_context_element.
    data ls_pdf type wd_this->element_pdf.
    data lv_pdf like ls_pdf-pdf.
    navigate from <CONTEXT> to <PDF> via lead selection
    lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    get element via lead selection
    lo_el_pdf = lo_nd_pdf->get_element( ).
    get single attribute
    lo_el_pdf->get_attribute(
    exporting
    name = `PDF`
    importing
    value = lv_pdf ).
    Get a reference to the from processing class.
    data: l_fp type ref to if_fp.
    l_fp = cl_fp=>get_reference( ).
    Get a reference to the PDF Object class.
    data: l_pdfobj type ref to if_fp_pdf_object.
    l_pdfobj = l_fp->create_pdf_object( ).
    set the pdf in the PDF Object
    l_pdfobj->set_document( pdfdata = lv_pdf ).
    set the PDF Object to extract data the Form data.
    l_pdfobj->set_extractdata( ).
    execute call to ADS
    l_pdfobj->execute( ).
    get the PDF Form data
    data: pdf_form_data type xstring.
    l_pdfobj->get_data(
    importing
    formdata = pdf_form_data ).
    convert the xstring from data to string so it can be processed using the iXML classes
    data: converter type ref to cl_abap_conv_in_ce,
    formxml type string.
    converter = cl_abap_conv_in_ce=>create( input = pdf_form_data ).
    converter->read(
    importing
    data = formxml ).
    pull in the iXML type group.
    type-pools: ixml.
    get a reference to iXML object
    data:l_ixml type ref to if_ixml.
    l_ixml = cl_ixml=>create( ).
    get iStream object from StreamFactory
    data: streamfactory type ref to if_ixml_stream_factory,
    istream type ref to if_ixml_istream.
    streamfactory = l_ixml->create_stream_factory( ).
    istream = streamfactory->create_istream_string( formxml ).
    create an XML document class that will be used to process the XML
    data: document type ref to if_ixml_document.
    document = l_ixml->create_document( ).
    create the parser class
    data: parser type ref to if_ixml_parser.
    parser = l_ixml->create_parser( stream_factory = streamfactory
    istream = istream
    document = document ).
    parse the XML
    parser->parse( ).
    define XML Node type object
    data: node type ref to if_ixml_node,
    attributes type ref to if_ixml_named_node_map.
    get the psi sales data Node and value.
    data ls_psi_sales type wd_this->element_psi_sales.
    data: lt_dfies type table of dfies,
    ls_defies type dfies.
    call function 'DDIF_NAMETAB_GET'
    exporting
    tabname = 'ZCM_PSI_SALES'
    ALL_TYPES = ' '
    LFIELDNAME = ' '
    GROUP_NAMES = ' '
    UCLEN =
    IMPORTING
    X030L_WA =
    DTELINFO_WA =
    TTYPINFO_WA =
    DDOBJTYPE =
    DFIES_WA =
    LINES_DESCR =
    tables
    X031L_TAB =
    dfies_tab = lt_dfies
    exceptions
    not_found = 1
    others = 2
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    data: lv_fieldname type string.
    field-symbols <fs_field> type any.
    loop at lt_dfies into ls_defies.
    lv_fieldname = ls_defies-fieldname.
    node = document->find_from_name( name = lv_fieldname ).
    assign component lv_fieldname
    of structure ls_psi_sales
    to <fs_field>.
    if <fs_field> is assigned.
    <fs_field> = node->get_value( ).
    endif.
    endloop.
    WRITE DATA INTO CONTEXT
    data lo_nd_psi_sales type ref to if_wd_context_node.
    data lo_el_psi_sales type ref to if_wd_context_element.
    navigate from <CONTEXT> to <PSI_SALES> via lead selection
    lo_nd_psi_sales = wd_context->get_child_node( name = wd_this->wdctx_psi_sales ).
    get element via lead selection
    lo_el_psi_sales = lo_nd_psi_sales->get_element( ).
    set all declared attributes
    lo_el_psi_sales->set_static_attributes(
    exporting
    static_attributes = ls_psi_sales ).
    Do I need such a code also to upload a word doc?
    Which interface / class exists for word documents? (for PDF upload there is the interface IF_FP)
    How can I save a document in SAP? (as MIME Object?  with which method?)
    I hope someone can help me!?
    BR

    You can use the fileupload and filedownload uielements.
    Check these links:
    [File Upload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm]
    [File Download|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    When you upload a file and save in SAP, are you saving it as xstring.
    If yes follow these steps for filedownload.
    Follow these steps for file download:
    1 Create FileDownload uielement in your View
    2.Create an Attribute of type xstring.
    3.Bind this attribute to the data property of your Filedownload uielement.
    4. during fileuplaod as you are saving the document in xstring format, fetch the same from your database table and pass the value to filedownload i.e set the attribute bound to data property of filedownload uielement with the xstring content.

  • Display word documents in portal content

    Hi,
    I have some word documents, which i want to display directly in the portal page. To display the documents I have generated a URL for each document and put this URL into an URL iView.
    But the problem now is, that it always opens a separate window for the word documents, although I have set the property "Open in portal content" in the iview and "Isolation Method - Embedded" in the portal page.
    Does somebody know, which additional settings are needed, to show the documents embedded in the portal page?
    Thanks in advance!
    Regards,
    Lydia

    Hi Lydia,
    The  "Isolation Method - Embedded" will NOT help at all in your case, the "Open in the portal content area" means that
    the iView itself will be opened in the portal content area, instead of a new windows.
    In your case, I agree with Raghu that you should use KM Document iView instead of URL iview, so please consider:
    1. createa separate KM document iViews for every DOC, make sure "Open in the portal content area" is set.
    2. craete a workset and assign the KM Document iViews to this workset
    3. assign this workset to a certain role and assign the role to your user.
    4. login with this user and try to launch the iview, then the DOC file should be opened in the same browser window
    Thanks and best regards,
    Thunder
    Edited by: Thunder Feng on Nov 19, 2010 2:07 AM

  • Display Word Document in ABAP WebDynpro

    Hi All,
    We have a number of word documents stored in the Business Document Navigator (Transaction OAOR) that we would like to display within a simple ABAP WebDynpro.  Demo program SAPRDEMO_FORM_INTERFACE shows how to retrieve a document from BDS via class cl_bds_document_set.  However, I am not seeing a similiar program for ABAP Web Dynpro.
    I was hoping that WebDynpro test application IOS_TEST_SIMPLE_MS would do the trick; however that appears to only work for a MIME repository object.  Is there a way to display these documents through ABAP WebDynpro?  Can anyone point me to a sample program?  Thanks.
    John

    Hi John
    Have a look at this thread [     Approach content repository other way then URL approach  |Re: Approach content repository other way then URL approach;.
    Thomas Jung delivers some (as always) excellent answers to a very similar problem. If the document is in DMS or BDS really doesn't matter so if I were you I would follow the "cached response" path.
    Also, do a google-search for --  abap "cached response" -- and you will find some additional links here (Thomas has even more to offer...).
    If you do follow this path please share some details as a follow up in this thread for the benefit of the community at large.
    Regards, Johan

  • Store and display word document in database through forms

    how can i store a word document in database through forms 6i or 10g, and display it through forms from database.
    i know how to store a binary file in database through DBMS_LOB package, but i want to do it throug forms. is it possible?
    regards

    Hi Alex
    "Create a datablock and specify the item datatype as blob"
    BUT: How to bring the document to the blob?
    Hi user 611..
    Warning: It is easy if you use an OLE-Object - but OLE is a special format. The result will not be the same as with dbms_LOB.
    We have a application with documents stored via OLE - terrible!
    OLE is no longer supported by forms 10. But webutil would help.
    I asked a similar question and got a good answer:
    OLE-Container and migration to the web
    Wolfram

  • Office Control does not display word document

    HI all,
    I followed the example code to display a word document in the office Control UI, but the display remains blank when I push the button to 'show document'.
    I do not have MS Office installed on the server so I have a wordpad named example.doc on the C drive. Can I read the data from wordpad and display it on the Office Control?
    Thanks
    Jay.

    > Thanks all,
    > I have Office 2003 installed on the client but not on
    > the server. The bytes[] array gets loaded with the
    > string '[B@10e770f', but the display stays empty.
    >
    > Jay
    Hi Jay,
    I need to use this feature as well. Did you get it to work. Can you display and edit a Microsoft Word document from within a browser page. It would be good to know that you have been successful.
    Jesse

  • Inconsistent Behavior When Displaying Word Document

    I use the following code to display an OrdDoc object on a web page using a servlet. When the object is a Word document and it is being displayed for the first time, the Word application handles the document. The second time it is displayed, the IE browser plug-in handles the document. Can you tell me why this is so? How can I get the Word document to just display in the IE browser everytime? Image objects are consistently displayed in the browser. Thank you.
    OrdDoc ordDoc = (OrdDoc)rset.getORAData(1,(ORADataFactory)OrdDoc.getORADataFactory());
    OrdHttpResponseHandler handler = new OrdHttpResponseHandler(actionRequest.getHttpRequest(),actionRequest.getHttpResponse());
                   handler.sendDoc(ordDoc);

    The ORDDoc type will not be able to recognized the WORD document and set the mimetype attribute correctly. Thus when you populate the object you should set the mimetype attribute yourself using the setMimeType() method of ORDDoc.
    When the object is fetched and sent on by the HttpResponseHandler, the handler will use the mimetype setting to set that field in the Response header. This should help browsers to handle the content correctly.

  • Displaying Word document in JEditorPane

    Hi,
    I (urgently) need to display a .doc file in a JEditorPane component..
    Can anyone sent here some simply piece of code??
    Thanx in advance!!
    Dewsqa

    Hey
    did you manage to find that out! Im trying to do the same, only have hours left to do so!
    If anyone knows how, please let me know.
    I have it all set up to display the file, just it will only read .txt files. How do you get it to display word docs?
    pane = new JEditorPane();
            try {
                pane.getEditorKit().read(new java.io.FileReader("file.doc"), pane.getDocument(), 0);
                pane.setEditable(false);
            catch (Exception e) {
                e.printStackTrace();
            Thanks Much appreciated

  • How to display word document attched to web template

    Hi,
    I have attached a word document to a web template in the web app. designer using menu option Web template --> documents.
    When I use web item "Single document" or "Document list" in my web template this word document does not show up. Did I miss a step here?
    Also, there were certain documents which were created directly as "documents for navigation status" but now, even after deleting them, the link still shows up??
    Regards,

    Hi Rumy,  you will need to create a link to the technical object's documetation. 
    Let me know if you have questions....
    Feel free to award the points to me...
    Ken

  • Displaying word document in apex

    Hi,
    i'd like to display a .doc in my page.
    I make a region in my page and in the source of my region i have the following code :
    <div style="">
    <embed height="100%" width="100%" name="embed_content" src="#WORKSPACE_IMAGES#InvAbr.doc" type="application/doc" />
    </div>But his don't work.
    Could someone help me?
    Thx in advance.
    Celio

    This is the tip I created for the users of one of the applications I programmed, showing them how to disable opening of the files in ther browser:
    If you are using Internet Explorer, the file will open within the browser. If you want to
    open the excel sheet in Excel, you need to change the settings in your Windows
    Explorer:
    1. In your Windows Explorer open the Advanced menue
    2. Go to "Options" and click the tab "File Extensions"
    3. Find the extension .xls and click on "Advanced" button
    4. Uncheck the check box "Open in the same Window"
    5. Confirm
    Now, excel sheet will open in Excel instead of opening in Internet Explorer.Now, you got to do the oposite to get it working. However, you can't force it since the settings are localy managed. The most hilarious thing is to change the behaviour of the Internet Explorer, you need to change the settings of the Windows Explorer ;) :)
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Safari Displaying Word Documents

    I am helping a friend who just switched from PC to Mac. They got a new iMac with 10.5.2 and the newest Safari (3.1.1?).
    Their child's school allows them to access assignments online. On their PC (MS Explorer) they can click the links (appear to be MS Word Docs) and they open in the browser window. In Safari these Word docs download to the computer.
    I tried holding the control key and selected "open in a new tab" and a new tab opened but it was blank and the file downloaded again (to the download folder).
    Is there a setting I have missed? Or does Safari just not "handle" Word files?
    I showed them the work-around of download and open in Word Processing.. But, they aren't happy because there are like 6 files a day that they check - to see the kid's assignment.
    By the way - we haven't loaded MS Office on the machine (using TextEdit) will loading Office help?

    Or does Safari just not "handle" Word files?
    This is the case - Safari cannot open Word files. Under Windows, Internet Explorer can open them, because IE and Word are both MS products, and they built integration into them. That's simply not the case with Safari and Word.
    So, the only option is to download them.
    As a side note, if you download all the files to the desktop (or elsewhere), on the Mac you can select all of them then double-click on one of them, and they will all open in the word processor. That "multi-file open" does not work in Windows, which I find to be a major annoyance...
    Hope this helps...

Maybe you are looking for

  • TS1717 error message New itunes library

    I hit the itunes icon on my home screen and the small error message box opens up and says "New itunes Library" with a "ok" tab..nothing else happens I'm running windows 7.  It worked less than one week ago, now nothing!

  • Basic Trivia Game

    I am looking to make a trivia game as a special feature on my dvd for my kids...1 trivia game per each kid 10 questions each...After each question a track is going to with them saying YAY or NO and then it proceeds to the next question....The questio

  • I get the"download iPod updater"message &downloading the updater won't help

    Here's what happened: I plugged my iPod into my iTunes to put music on it. It says "Do Not Disconnect" like it alwasys does, but this time doesn't go away. It stays for 45 minutes. IN an act of desperation, I disconnect. I lose everything. "Not a big

  • SQL Developer Data Wizard - Row terminator question

    Hi all, I'm new to SQL Developer and am using the wizard to import a dataset with a non-standard row terminator The row terminator essentially looks like 2 spaces but its actually 2 newline characters. In SQL Server I specified the following in the S

  • Subquery in dynamic where-clause

    Hi, i'm trying to build a dynamic sql-statement in OPEN SQL, which uses a subquery in the dynamic where-clause. In the following example code the first select works fine, the second one raises an error. report  zerrorforum. data:   l_var_anzahl * No