Content in Jsp to be converted to Word Doc

I have .jsp page. with some generated content. In that page, there is an option Convert to Word DOC PAGE. When the link is clicked , the content in the JSP page has to be converted to a Word Doc. How to do?

<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import = "java.io.*" %>
<HTML>
<HEAD>
<script language="JavaScript">
var fso = new ActiveXObject('Scripting.FileSystemObject');
var wdApp = new ActiveXObject("Word.Application");
function readFromFile(fileName)
     if (fileName == "C:\\Award_Ltr.TXT")
var fs = fso.OpenTextFile(fileName);
var result = fs.ReadAll();
return result;
function readFromWord()
alert("PLEASE SAVE THE FILE AS C:\PPY Letter for Annuities to Retirees and Alternate Payees wi_temp.doc");
var pause = 0;
var wdDialogFileOpen = 80;
var wdApp = new ActiveXObject("Word.Application");
var dialog = wdApp.Dialogs(wdDialogFileOpen);
var button = dialog.Show(pause);
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="formName">
<INPUT TYPE="file" NAME="fileName">
<INPUT TYPE="button" VALUE="show"
ONCLICK="this.form.fileContent.value = readFromFile(this.form.fileName.value)">
<BR>
<TEXTAREA NAME="fileContent" ROWS="20" COLS="90" WRAP="off"></TEXTAREA>
<BR>
<INPUT TYPE="button" VALUE="SaveExtract" >
<BR>
<INPUT TYPE="button" VALUE="Modify Template" onClick = "readFromWord()">
</FORM>
</BODY>
</HTML>

Similar Messages

  • How do I convert a word doc to pdf?

    I cannot seem to convert a word doc to a pdf- it keeps taking me back to the subscription page and I already have signed up for that. HELP!

    Hello Saundra,
    I'm sorry to hear you're having trouble.  Could you post a screenshot of what you see when you try to log in here: http://createpdf.acrobat.com/signin.html ?
    -David

  • How do I convert a WORD doc to pdf on my Mac

    How do I convert a WORD doc to pdf

    Easiest way if you have Word installed: from Word's File menu, do "Save as..." and you will find a pdf option in the "Format" pull-down:
    The example is from Office:Mac 2008; should be similar in Office 2011.

  • Unable to convert Microsoft Word doc. to PDF in Words (there is no response)

    Unable to convert Microsoft Word doc to PDF in Words (Does not respond) or Create PDF from a Word doc. in Adobe Acrobat X Standard 10.1.1 with all updates installed. I receive apop-up saying "Missing PDF Maker Files: Dou you want to run the installer in Repair Mode"  I have done this several times. I have un-installrd and re installed the program twice. Still does not work. I'm running Windows 7 Home version and Microsoft Office XP 2002. This is a brabd new Acrobat program right out of the box. Suggestions Please.

    In WORD 2002, I believe you can only print to the Adobe PDF printer. I think that WORD 2003 is the first compatible with AA X. Check out http://kb2.adobe.com/cps/333/333504.html.

  • I have two pdf docs that I used Acrobat to convert to word docs.  How do I extract one page from one doc to insert into the other doc?

    I have two pdf docs that I converted to Word Docs using Acrobat Pro.  How do I extract one page from the first doc and insert it into the second doc?  When I "select all" it grabs the entire document.  I need to take pages out, put other pages in, and edit some of the text.

    HI djlarp,
    Try triple-clicking in the text that you want to select--it can sometimes be tricky to select text in a converted document. If that doesn't work, it could be that the PDF document was created from a scanned document, and OCR wasn't enabled when you converted the document. (However, OCR is enabled by default when you convert via the ExportPDF website.)
    If you're unable to select text by triple-clicking, let us know. I would be happy to take a closer look at your files.
    Best,
    Sara

  • I have a Word doc with lots of Excel/Pdf attached doc inside. Can I convert this word doc in PDF keeping the attached documents inside the PDF? or do I have to attach all af them again? thank in advance

    I have a Word doc with lots of Excel/Pdf attached doc inside. Can I convert this word doc in PDF keeping the attached documents inside the PDF? or do I have to attach all af them again? thank in advance

    Attach all of them again.
    Be well...

  • Michaelp70541244. I have converted a word doc. to pdf, but none of the fonts are embedded.

    Anyone know the answer?

    Hi michaelp70541244,
    What did you use to convert the Word doc to PDF? Regardless of the method you used, however, some fonts will never be embedded, if licensing for those fonts restricts it.
    Best,
    Sara

  • I downloaded the trial version of Adobe XL for converting a Word doc into PDF - can't find it.

    I downloaded the trial version of Adobe XL for converting a Word doc into PDS - can't find it now.  Need asap!

    You want the forum for Acrobat then: Acrobat

  • I'm converting a word doc to a pdf and have a color spin wheel - going on 10 min now. any clue as to why? or how i make it stop?

    I'm converting a word doc to a pdf and have a color spin wheel - going on 10 min now. any clue as to why? or how i make it stop?

    Hit command tab and swtich to the Finder, under the Apple menu is Force Quit, do that to the program that is causing your "hang" and restart the program and what you were doing.
    If you didn't save your file beforehand, then your going to have to make it again.

  • How do I get the ability to convert my word .doc file to flashpaper?

    How do I get the ability to convert my word .doc file to
    flashpaper?
    I had cs3 installed but I just installed MS word 2007 and the
    ability to export to flashpaper is not available that I can see.
    Do I have to reinstall contribute in order for it to install
    the flashpaper exporter to word?
    -Line

    If I understand you correctly, you need to Scale and Position each clip.  These are part of the inherent Motion effect attached to every clip, found in the Effects Control Panel.

  • How to convert Ms Word (.doc) file to Protected pdf

    Hi all,
    Is anybody out there could help me on how to convert Ms Word (.doc) file to protected pdf file using java? May be there are some jar file I need to download or any tools you used before? Thanks in advance... =)

    Hi all,
    Is anybody out there could help me on how to convert
    Ms Word (.doc) file to protected pdf file using java?
    May be there are some jar file I need to download or
    any tools you used before? Thanks in advance... =)Hi All,
    Thanks for your replies..I think i almost find the solution. I found 2 options to do this. They are :
    1. Get Adobe Acrobat and it's SDK (has to buy)
    2. Get OpenOffice 2.0.4 and it's SDK (opensource)
    So, i do option 2. I install them in my system.then i call them from my ide. Then i follow the code from this link..
    http://weblogs.java.net/blog/tchangu/archive/2005/12/open_office_jav_1.html
    Thanx.. =)

  • Hello, is there a way to redact a word or item from a pdf using adobe pro X the same way you can if you convert a word doc using pro X on a pc?

    hello, is there a way to redact a word or item from a pdf using adobe pro X the same way you can if you convert a word doc using pro X on a pc?

    If the document is not a scanned image or protected from editing then you should be able to edit it. I would have to guess you have a scan and when you converted to Word, you ran OCR (Optical Character Recognition) on it converting the scanned image to live text.
    This is the forum for the free Adobe Reader which can not edit or redact.

  • Convert MS Word (.doc) document to pdf document

    Hi All,
    My requirement is that I need to convert MS Word (.doc) document to pdf document.
    Is there any standard SAP function module.
    Pls guide me.
    Rishi

    I dont understand why you want to use SAP to convert word file to PDF file.
    1. Search in google
    2. www.win2pdf.com - this may be useful
    Still if you want to use SAP to do that then follow the below procedure.
       1. Upload the data from word to internal table using the function module : GUI_UPLOAD.
       2. Use spool :
                  1) RSPO_OPEN_SPOOLREQUEST - Open spool request
                  2) RSPO_WRITE_SPOOLREQUEST - Write to spool request
                  3) RSPO_CLOSE_SPOOLREQUEST - Close spool request
       3. use the function module CONVERT_ABAPSPOOLJOB_2_PDF to convert spool in to PDF format.
    Regards,
    ~Satya

  • Converting a word Doc to a dynamic PDF

         When I try to convert a word Doc to a dynamic PDF doc the process stalls at 94%. How can I get it to finish?

    I am using Adobe Acrobat X Pro on a workstation using Windows 7.
    I have converted docs this way many times before, but for some reason it does not seem to complete the process about 50% of the time these days.
    Here is a screen shot
    Thanks!! Tom

  • Downloaded adobe for free trial. Now it's asking for money. I only want to try converting a word doc into a form. Also why is it all in Spanish when I asked for English?

    I just downloaded adobe XI (Adobe told me to upgrade to this for a free trial) I only want to convert a word doc into a form. Now Adobe are asking for money for me to do so. So..where is the free trial? Also I requested English and it is all in Spanish? Help!

    You want the forum for Acrobat then: Acrobat

Maybe you are looking for