Urgent ! writing html document into msword

Hi,
I would like to write html document into word document(save as).
More over the word document is a template(with company's header and footer).the html code should go and sit in the template document.do I have to use some external pkg like jacob or it's possible in java.Plz any input would help me a lot.
Regards,
Ashok.

Word is Windows creature and has perfect COM automaion interfaces, just write your application with Delphi. Other platforms have nothing to do with Word.

Similar Messages

  • Writing html page into word document

    HI,
    I want to write the HTML document using java code in to a word document.
    When I save the webpage as word document. It's properly saving the font...
    I almost did it with following code but the font is missing it is just writing all the text in single font.I want the exact replica of the html page in to the word document.Plz help me out with some input.
    Thanx in advance.
    Regards,
    Ashok.
    public String readContent(){
    String contText="";
    EditorKit kit = new HTMLEditorKit();
    Document doc = kit.createDefaultDocument();
    // The Document class does not yet
    // handle charset's properly.
    doc.putProperty("IgnoreCharsetDirective",Boolean.TRUE);
    try {
    // Create a reader on the HTML content.
    Reader rd = getReader(fileName);
    // Parse the HTML.
    kit.read(rd, doc, 0);
    // Iterate thsrough the elements
    // of the HTML document.
    //ElementIterator it = new ElementIterator(doc);
    //javax.swing.text.Element elem;
    //while ((elem = it.next()) != null) {
    //SimpleAttributeSet s = (SimpleAttributeSet)elem.getAttributes().getAttribute(HTML.Tag.A);
    // code to read the content
    int nleft = doc.getLength();
    Segment text = new Segment();
    int offs = 0;
    text.setPartialReturn(true);
    while (nleft > 0) {
    contText+=doc.getText(offs,nleft);
    System.out.println(contText);
    // do someting with text
    nleft -= text.count;
    offs += text.count;
    if(nleft > 0)break;
    /*if (s != null) {
    //System.out.println(s.getAttribute(HTML.Attribute.HREF));
    System.out.println(s.getAttribute(HTML.Attribute.HREF));
    } catch (Exception e) {
    e.printStackTrace();
    //System.exit(1);
    return contText;
    } //end of reading content method
    static Reader getReader(String uri)
    throws IOException {
    if (uri.startsWith("http:")) {
    // Retrieve from Internet.
    URLConnection conn = new URL(uri).openConnection();
    return new InputStreamReader(conn.getInputStream());
    } else {
    // Retrieve from file.
    return new FileReader(uri);

    Maybe Im missing something here, but where are you doing anything using MS Word? I see you write the text to std out but where does it go to a word document? How do you create the word document, using JNI or is it a java API?

  • Writing Html Content into PDF using JSP

    Dear All,
    I am using JSP to generate Employee payslip dynamically. Presently i am diplaying payslip as on-screen display.
    Here i want to give option "Save as PDF". I am able to create PDF file using IText Libraries. i want to integrate HTML code into the PDF file.
    Writing HTML Content (using HTML Tags) into PDF.

    Well it is a difficult ask and i believe we are trying to re-invent the wheel
    Just to make my life simple i could have choosen either sample API given below to serve my cause
    1).[http://xmlgraphics.apache.org/fop/] (Apache FOP one can simply write an XSL template of their and then substitute the values from respective DTO's by using XSL - XML transformations and can generate content in different formats which includes PDF aswell)
    2).[http://jasperforge.org/plugins/project/project_home.php?group_id=102] (Just design a simple report template using iReport and create a jrxml files and write a small code snipett such that you can pass few details at the runtime and can export the report in different formats which includes PDF aswell)
    3).[http://www.object-refinery.com/jfreereport/] (Is much similar to what jasper offers in order to compile these you can either use pentaho product IDE or BEA/Oracle Actuate report tools)
    You can simply try searching for different examples for getting more help on using the respective API's
    Hope that helps :)
    REGARDS,
    RaHuL

  • Converting HTML document into Document

    i want to convert the text of an HTML page into a document...
    how can i do that....plzz any ideas...
    Edited by: ping.sumit on Jul 14, 2008 10:28 PM

    If you mean a word document the simply right click-> open with -> Microsoft Word
    if you mean a Java Document then parse it as an XML file because the HTMLDOM is basically XML Syntax
    Don't know about Scripts though probably end up being the content of the <Script> tags

  • Bring html documents into Pages

    Is there a program/visual editor that will let me bring html formatted documents (preserving columns, bold face, indents, etc) into Pages to edit? Maybe something like the old Netscape composer?
    MacBook Mac OS X (10.4.7)
    MacBook   Mac OS X (10.4.7)  

    If you like Pages than try iWeb, an app included with iLife 06. It builds web pages graphically. You should have it on your machine.
    Kurt

  • HTML document in portal

    Dear friends,
    I got an issue like, my client need to put their HTML document into the portal, its around 300 files. So how to put htis html document into portal. Is it possible to put the html document or not, If not how to make appear HTML document in portal.
    Kindly help me
    Regards
    Suresh

    hi
    first you need upload the html files int oKM content then you need  to create a iviews  based on this content present in KM content
    step 1: uploading the html files
    go to content administration->KMcontent->at the right hand side select the document folder->
    here u create a new folder by selecting folder menu->new->folder
    then your folder will be created under documents folder
    doble click on this (now you under documents/your folder path)
    under you folder
    select folder menu->new->upload
    give  name(ex new.html ),description, and select browse to upload the file
    follow the same procedure for all the html files
    this indicates the u have uploaded all the files properly
    now creating a ivews based on the html documents uploaded in KM content
    content administration->portal content->select your folder->right click ->new->iview->select KM document iview template->give iview name &id etc
    then open the iview for editing
    there u can find a property called " path to document" give the value as " \document\<your folder name where u uploaded the html files under KM content>\file name(ex:new.html>
    like that u can create all the iviews based on the html documents stored under km content
    rgds
    srinivas

  • HTML document feedback to java

    hi,
    I am trying to load a HTML document into JEditorPane (for viewing only). The HTML document contains a TextField and a Button, is there a way to notify my application whenever the Button is pressed?
    Thank You!

    Wow, it must take quite some time to figure this out:
    http://forum.java.sun.com/thread.jsp?thread=414212&forum=57&message=1885273

  • Upload HTML document...

    When I try to upload a HTML document into a folder using Upload iView everything works fine and the portal reports "... document uploaded", but the document does not appear inside the folder. I guess it gets deleted immediately. Strangely, this problem
    applies only  to  HTML documents. Is it because of some content translation malfunction?
    Thank you for your comments.

    The problem is solved. It was because of a repository service with the code
    if (resource.getContent().getContentLength() < 0)
      resource.delete();
    Somehow, this statement always returned -1 for HTML files (some filter probably is screwed up!)
    I changed it to:
    if (resource.getUnfilteredContent().getContentLength() <=0)  ....
    Regards.

  • Losy images after importing Word document into RoboHelp 7 HTML

    We imported a simple Word document into RoboHelp 7 HTML, as a
    new project (from scratch).
    Everything worked out pretty well (afterall, this was just a
    simple Word document), and we expect to have to tweak the styles,
    etc. That is understood.
    However, the images that were embedded in the Word document
    (as opposed to saved to disk, and only linked to the Word document)
    do not look very nice in the RoboHelp 7 HTML project topics.
    When we browse to the iamge folder, and view the actual image
    files, these images do not look too bad. But in the Design View,
    the images have display issues (solid color bars on the
    sides/top/bottom of the images). When we compile to a Single Source
    Layout (except PDF), the images look fine again. When we create
    Printed Documentation, even for the best PDF-settings, the images
    look terrible -- smudgy, like low resolution quality).
    1) Except for storing the images outside of the Word document
    before importing, and then manually linking them back into the
    imported RoboHelp HTML files, is there a way to maximize the
    quality of the imported Word images in RoboHelp HTML?
    2) Why doe the images look worse in Printed Documenation
    (PDF), even for the highest PDF settings, than for the other Single
    Source Layouts?
    While I am typing, I realized that we should try to include
    the images in Word via a link to the image files on disk. Perhaps
    then RoboHelp will not actually modify the image files during
    import. I will report back about this one.
    Your help will be greatly appreciated!

    Looks perfect, works terribly...
    Things to consider:
    Chances are, the different treatments of the space are due to whether the space was included in the bolding of the word in MS Word.
    Additionally, since Word files contain much underlying binary code (macros and such), your security settings might or might not be playing well with the Word stuff.
    Are you importing the Word file from a network location, or from your local machine? Network traffic might be partially impacting the import, too.
    Bottom line? You'll probably need to clear all formatting in the Word file and redo the formatting properly. To test this, cut a couple of pages into a new Word file, clear and redo the formatting in Word, import the Word file into another RH project, and see what results you get.
    To clear the formatting:
    Select text.
    On the Home tab, in the Font group, click Clear Formatting.
    Redo the formatting, being careful to not format the spaces.
    Good luck,
    Leon

  • Importing Word Document into RH HTML

    I'm trying to Import a Word Document into RoboHelp HTML and I
    receive this message.
    "Import Session Failed 0x80004005. "
    What can I do to Import the document properly?

    This is a permissions issue. Click
    here for
    information on how to fix this.

  • Loading scripts - what's the difference between loading into edge via script window and including a script in the html document?

    I have a html page that loading in two edge compositions and an external custom javascript file. The javacsript file includes the bootstrapCallback so I can store references to the loaded compositions and can communicate with them. This seems to work well. The problem have is when I also try and load in a custom plugin javascript files into the edge compositions via the script window inside edge - I don't understand how this works, for example if I load in a custom javascript file into one of the compositions can only that composition use it's funcitionality? Is loading in scripts via edge script window the same as including in html document, I'm confused how the two relate, please help me understand.

    I have a html page that loading in two edge compositions and an external custom javascript file. The javacsript file includes the bootstrapCallback so I can store references to the loaded compositions and can communicate with them. This seems to work well. The problem have is when I also try and load in a custom plugin javascript files into the edge compositions via the script window inside edge - I don't understand how this works, for example if I load in a custom javascript file into one of the compositions can only that composition use it's funcitionality? Is loading in scripts via edge script window the same as including in html document, I'm confused how the two relate, please help me understand.

  • Insert pdf into html document

    Hi there,
    I would like to import or insert a pdf file (acrobat) into an
    html document
    and be able to write above and below the document. I have
    copied the document
    into MS paint and saved it as a gif file and inserted it that
    way...Is there any more
    direct way to do this? I have not been able to copy and paste
    directly into DW from
    adobe acrobat....Please advise!!
    Thanks abunch!
    RC

    crash wrote:
    > Adobe Acrobat is a plugin, and as such it requires the
    plug-in to view. You
    > cannot "mix" a pdf and HTML AFAIK. The PDF must be view
    in the PDF
    > application.
    >
    > You can, of course, convert your PDF to any image format
    and place it within
    > your content as you've done.
    >
    > You might try using frames, but I don't know how
    successful that would be
    > (sounds a bit nightmarish to me).
    >
    > HTH,
    >
    > Jon
    >
    > "rcshell" <[email protected]> wrote in
    message
    > news:e48u6r$nmi$[email protected]..
    >> Hi there,
    >> I would like to import or insert a pdf file
    (acrobat) into an html
    >> document
    >> and be able to write above and below the document. I
    have copied the
    >> document
    >> into MS paint and saved it as a gif file and
    inserted it that way...Is
    >> there
    >> any more
    >> direct way to do this? I have not been able to copy
    and paste directly
    >> into
    >> DW from
    >> adobe acrobat....Please advise!!
    >> Thanks abunch!
    >> RC
    >>
    >
    >
    Or you could convert the pdf to FlashPaper, then insert as
    you would an
    image. You choose the size.

  • How to insert Transition object into html document

    Hello Friends,
    I am trying to insert Transition object ( downloaded from
    Extension) into HTML document.
    I tried Insert -> HTML -> Head Tags -> Transitions,
    but after doing all this I am not able to insert
    this extension in my document.
    As I am beginner to Dreamweaver, Can anyone pls. help me out?
    I am using Dreamweaver 8.
    Do I need to select <img> tag before inserting
    Transition Object?
    Pls. pls. help me out.....
    Waiting for reply.
    Thanks in advance for your help.

    When I used to do tabs I would set up a page that was as wide as the tab sheet including the tab, then add text frames in each tab position.

  • Link one solution manager word document into another solution manager HTML

    Hi,
    I have requirement in solution manager that there are two documents uploaded into solution manager.
    1. One word document in one of the project folder
    2. HTML page in another folder of same project
    I have to set up a hyper link of word document in the HTML web page.
    If anyone has gone through this type of requirement, please let me know the details of how did you set up the link between word and HTML document.
    Appreciate the early response.
    Thanks,
    Siva

    Go to the properties of the file you want to link your word document to. (attributes icon)
    There you will find a button "Generate Document URL (F9)". Clicking this button will buffer the URL into clipboard.
    Then you open your Word document in edit mode and paste the URL there.
    source: Inserting a document into another in Solution Manager

  • Writing html file in a jeditorpane

    I have read one of your threads titled as "How to insert a string in a JEditorPane (Urgent)". according to this thread I am using insertString() method to write in an jeditorpane. what I am writing is an html file. when I used insertString() method it doesn't show the html content in my jeditotpane. it displays the source code of my html file. I have setContentType("text/html"); moreover I used setText() and it shows the html file correctly but it over writes the previous content of jeditorpane. please help me to be able to
    write to a jeditorpane without overwriting and displaying html file properly not its source code.
    following is my code:
             fr = new FileReader("myfile.html");
         BufferedReader br = new BufferedReader(fr);
         while ((lineread = br.readLine()) != null)
              find.append(lineread);
                       do{
                             last = find.lastIndexOf("str");
                          Integer index = myJEditorPane.getSelectionEnd();
                   String temp = index.toString();     
                   start=find.indexOf(temp, end);
                   end=find.indexOf("str", start);
                            Document doc = mynewContentPane.getDocument();
                   try{
                        doc.insertString(doc.getLength(),find.substring(start, end),null);
                   catch(BadLocationException exc){
                        exc.printStackTrace();
                   }Edited by: nasi on May 7, 2010 8:59 PM
    Edited by: nasi on May 8, 2010 12:09 AM
    Edited by: nasi on May 8, 2010 1:37 AM

    Welcome to the Sun forums.
    Subject: writing html file in a jeditorpane
    If you mean a JEditorPane then please use the correct case, so we can be confident you refer to the J2SE class, as opposed to a 3rd party jeditorpane that we neither know, nor support.
    nasi wrote:
    I have read one of your threads titled as "How to insert a string in a JEditorPane (Urgent)". ..I guess you mean [How to insert a string in a JEditorPane (Urgent)|http://forums.sun.com/thread.jspa?threadID=282569] from 2002. A lot has changed since 2002, but I suspect the basic way of appending text to a Document has not.
    BTW - Good to see you arrive with some Google-foo. ;-)
    ..according to this thread I am using insertString() method to write in an jeditorpane. what I am writing is an html file. when I used insertString() method it doesn't show the html content in my jeditotpane. it displays the source code of my html file. I have setContentType("text/html"); moreover I used setText() and it shows the html file correctly but it over writes the previous content of jeditorpane. I've not played much with changing existing documents, but try this source (adapted from code nabbed from the thread you mentioned).
    import javax.swing.text.*;
    import javax.swing.*;
    public class InsertStringTest {
        public static void main(String[] args){
            Runnable r = new Runnable() {
                public void run() {
                    //set GUI
                    JFrame f = new JFrame();
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    JEditorPane editorPane = new JEditorPane();
                    editorPane.setContentType("text/html");
                    editorPane.setText("<html><body><h1>Test!</h1><p>");
                    f.getContentPane().add(new JScrollPane(editorPane));
                    String testStr = "This is a test string. " +
                        "This is a test string. This is a test string. \n";
                    f.pack();
                    f.setSize(400,300);
                    f.setVisible(true);
                    //test with insertString()
                    long diff;
                    long startTime = System.currentTimeMillis();
                    Document doc = editorPane.getDocument();
                    for(int i=0; i < 500; i++){
                        try{
                            doc.insertString(doc.getLength(),testStr,null);
                        catch(BadLocationException exc){
                            exc.printStackTrace();
                    diff = System.currentTimeMillis() - startTime;
                    System.out.println("Time spent with doc.insertString() : " + diff);
                    editorPane.setCaretPosition(0);
            SwingUtilities.invokeLater(r);
    }

Maybe you are looking for

  • Charged for premium application, when I canceled years ago.

    I recently contacted Verizon about charges that they said were "surcharges". I'm an honest person and when I see a bill in the mail I just go online and pay it. Finally opened a paper bill to find out the $9.99 is for my premium Slacker radio that wa

  • Advanced DataGrid SUM

    Hi All, I'm trying to SUM columns and display the total column at the end of each group using: <mx:GroupingCollection id="groupedData" source="{acData}" >                             <mx:Grouping>                                 <mx:GroupingField nam

  • Shows NO photos to import !

    In Aperture2, when I try to import images(command-I) from hard disk, as I did in Aperture1.5, I got a empty list in dialogue box, no photo to choose. Anyone face the similar problem?

  • User deleted posted miro invoice

    Hi SAP Gurus, Surprisingly user was able to delete the posted MIRO invoice (infact a paid invoice) using MIR4, then going to Edit- Display/Change and Invoice document-Delete. I can see the deleted invoice under Purchasing history in the PO but when i

  • Shortcut on keyboard stopped working on mac book

    So I have restarted my computer twice, and my shortcuts on the keyboard on Illustrator CC is still not working, I have updated all my adobe products this past weekend. So I am not sure if I just pressed something wrong or it just is just malfunctioni