Add a header/footer in MsWord(.doc) file using POI in java

hi experts,
I want to add a footer/header in the existing MsWord(.doc) file using POI in java without changing its original format.
can anybody help me?
Thanx.

What you describe tends to indicate that you're using Reader, not Acrobat. If you do have Acrobat installed, make sure you're using it and not Reader.

Similar Messages

  • How do I add a header/footer to a document?

    I am using Adobe X Standard, version 10.1.2 and everything I am reading tells me to go to tools>pages>Header & Footer>Add Header & Footer, but once I click on tools to the left, the only options I have are export and create pdf files and send files. There is no tools option in the tool bar on the top. File, edit, view, window & help are my only options. How can I add a header/footer to a document?!

    I think you might be opening your Pdf document in Adobe Reader. If you try open your pdf document in Adobe Standard and check again as far as your option are concerned you should be able to do that.

  • How can I add a header/footer to a document?

    I am using Adobe X Standard, version 10.1.2 and everything I am reading tells me to go to tools>pages>Header & Footer>Add Header & Footer, but once I click on tools to the left, the only options I have are export and create pdf files and send files. There is no tools option in the tool bar on the top. File, edit, view, window & help are my only options. How can I add a header/footer to a document?!

    What you describe tends to indicate that you're using Reader, not Acrobat. If you do have Acrobat installed, make sure you're using it and not Reader.

  • How to open a doc file using jsp Anchor tag

    when i am trying to open a doc file using a jsp it is opening with out proper alignment.
              how to open a doc file with proper alignment using Anchor Tag in JSp Page
              

    Hello!
    Does some one of you had open a MS word file (.doc) in Java search for a token like [aToken] replace it with another text and then feed it to a stream of save it?
    I want to build a servlet to open a well formatted and rich on media (images) ms word document search for tokens and replace them with information form a web form.
    Any Ideas?
    Thank you in advanced.

  • File Visibility in uploading the file using web DynPro java

    hello,
    i have gone through the tutorial " uploading & downloading the file using web DynPro java".
    the upload functionalty is working fine. but i need to know thw path where these files are getting uploaded ??
    Waiting for the reply..
    Regards,
    Viren Gupta

    Hi Viren,
    Are you are refering to the below tutorial for upload and download:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e10426-77ca-2910-7eb5-d7d8982cb83f?QuickLink=index&overridelayout=true
    If yes, then answer is that the file is stored in the context of the application only as "com.sap.ide.webdynpro.uielement-definitions.Resource" object. Please read through the tutorial to understand the full process.
    WD doesn't really upload to server automatically unless there is any explicit code written. All it does is to store the file in a temp context which you can access and write your own code to store it in a particular location.
    Regards,
    Mahesh

  • Problem in Uploading excel file using WebDynpro for Java

    Hi  All
    I have followed for Uploading excel file using WebDynpro for Java added by  Tulasi Palnati
    I done all, but I'm getting 500 Exception please contact u r system admin meag  at run time also  Jxl/Workbook class not found msag  but i downloaded Jxl.jar file and  there is no error signals  in coding part. How can I solve the Problem.
    Thanks
    Polaka

    Please ask the people in the Web Dynpro Java forum for a solution.

  • Reading/Writing .xlsx files using Webdynpro for Java

    Dear All
    I have a requirement to read/write excel files in .xlsx format. I am good in doing it with .xls format using jxl.jar. The jxl.jar doesn't support .xlsx format. Kindly help me in understanding how do I need to proceed on reading/writing .xlsx files using Webdynpro for Java.
    Thanks and Regards
    Ramamoorthy D

    i am using jdk 1.6.22 and IBM WebSphere
    when i use poi-3.6-20091214.jar and poi-ooxml-3.6-20091214.jar  to read .xlsx file. but i am getting following errors
    The project was not built since its classpath is incomplete. Cannot find the class
    file for java.lang.Iterable. Fix the classpath then try rebuilding this project.
    This compilation unit indirectly references the missing type java.lang.Iterable
    (typically some required class file is referencing a type outside the classpath)
    how can i resolve it
    here is the code that i have used
    public class HomeAction extends DispatchAction {
         public ActionForward addpage(
                             ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
                             throws Exception {     
                             String name = "C:/Documents and Settings/bharath/Desktop/Book1.xlsx";
               FileInputStream fis = null;
               try {
                   Object workbook = null;
                    fis = new FileInputStream(name);
                    XSSFWorkbook wb = new XSSFWorkbook(fis);
                    XSSFSheet sheet = (XSSFSheet) wb.getSheetAt(0);
                    Iterator rows = sheet.rowIterator();
                    int number=sheet.getLastRowNum();
                    System.out.println(" number of rows"+ number);
                    while (rows.hasNext())
                        XSSFRow row = ((XSSFRow) rows.next());
                        Iterator cells = row.cellIterator();
                        while(cells.hasNext())
                    XSSFCell cell = (XSSFCell) cells.next();
                    String Value=cell.getStringCellValue();
                    System.out.println(Value);
               } catch (IOException e) {
                    e.printStackTrace();
               } finally {
                    if (fis != null) {
                         fis.close();
                return mapping.findForward("returnjsp");

  • Need to transfer files using sftp via java api's.

    Hi,
    I got a requirement to transfer files using sftp via java api's.
    Kindly specify any 3rd party Java Libraray to do this.
    The requirements are
    -It must support extensive encryption algorithms.
    -It must allow generating public/private keys and authenticating with server by sending the keys first(before the actual file transmission).
    Thanks.

    Don't resurrect old threads, please. Start your own thread.
    Better yet: google for "Java SFTP", look at what you find and come back when you have a specific question.
    And: when you ask a specific question, then clarify if you're talking about the [SSH file transfer protocol|http://en.wikipedia.org/wiki/SSH_file_transfer_protocol] or about FTPS, which is sometimes (wrongly) called SFTP.

  • Addition of a header line to a flat file using Custom Adapter Module?

    Is the header that you want to add to the input file always a constant?
    In that case why go for a module. Directly map the required constants during the mapping to your IDoc.
    My suggestion is to avoid the module

    Hi Shabrish,
    The Header is not a constant field always as the value changes per file adapter so a module will be helpful, and it will be a must to add the Header record as the first line.
    Can you suggest/direct me to some appropriate blogs? Thanks
    Regards,
    Nipun

  • Heading  during downloading into local file using GUI_DOWNLOAD fun.module

    Hi Guru's
    we have a requirement that we want the plant description as a heading (first line of the file) in the local file. iam using "GUI_DOWNLOAD" function module for downloading data for which iam passing the charecter type internal table. before downloading iam passing all the filed headings to that table and then appending the internal table data into it. now iam getting data properly with field headings . but before that heading i want one more description for a plant field which iam using in my selection screen
    in the fun.module "GUI_DOWNLAOD"
    we have HEADER file but it is of XSTRING type so it is taking only 2 char.
    so how to use this . Plz help me.
    thanks well in advance.
    UR's
    GSANA

    Hi,
    Please check the below link,
    header in 'gui_download'
    Also check Manoj kumar's reply in the link,
    header information to gui_download
    Hope this helps.
    Best Regards.

  • Problem in opening a doc file using Runtime.exec()

    Code:
    import java.io.*;
    class StreamGobbler extends Thread {
        InputStream is;
        String type;
        StreamGobbler(InputStream is, String type) {
            this.is = is;
            this.type = type;
        public void run() {
            try {
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null) System.out.println(type + ">" + line);   
            catch (IOException ioe) {
                 ioe.printStackTrace(); 
    public class GoodWindowsExec {
        public static void main(String args[]) {
             String file = "test.doc";
             String appPath = "/C";
            try {
                String osName = System.getProperty("os.name" );
                System.out.println("OS : " + osName);
                String[] cmd = new String[3];
                if( osName.equals( "Windows NT" ) || osName.equals( "Windows XP" )) {
                    cmd[0] = "cmd.exe" ;
                    cmd[1] = appPath;
                    cmd[2] = file;
                else if( osName.equals( "Windows 95" ) ) {
                    cmd[0] = "command.com" ;
                    cmd[1] = appPath;
                    cmd[2] = file;
                Runtime rt = Runtime.getRuntime();
                System.out.println("Execing " + cmd[0] + " " + cmd[1] + " " + cmd[2]);
                Process proc = rt.exec(cmd);
                // any error message?
                StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");           
                // any output?
                StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
                // kick them off
                errorGobbler.start();
                outputGobbler.start();
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);       
            catch (Throwable t) {
                t.printStackTrace();
    }I got this code from internet. Program will work fine if my "test.doc" is in "C:\test.doc" directory. Is there any way to get the application path and open the doc file or how to give a specified path for my doc file
    EG:- "C:\TestDir\test.doc"
    Thanks

    Well /C is not the path to the app. It is a switch to
    the command line.
    set your file name to "C:/test.doc"
    ~TimSorry, I guess my reply doesn't really answer the problem. But you can supply the entire path as part of the file name string.
    String file = "C:/Path/To/My/File/to execute/test.doc"

  • Add a line to end of the file using VBscript

    HI
    I am working with a software that only accept Vb script commands.
    I have a file that has 8 columns. I need to add a line at the end of the file using VB script
    I need this line to add numbers of amount column and put 22 in 7th column and leave the rest empty.
    example:
    2.01E+13
    77008900
    9.88
    6/3/2013
    1/14/2014
    1/17/2014
    2.01E+13
    77008900
    66.07
    6/5/2013
    1/14/2014
    1/17/2014
    added line
    66.07+9.88=75.95                                               
    22
    the files have different number of rows. please help

    why in the word you think you are smart as the fact is that you don't know shit.
    I explained to you that the software has the ability to edit the file using VBscript. Now if you cant do it dont say that it makes no sense. because others already help me to solve this.
    do everyone a favor and don't answer my questions please, Well you never answered any, don't post any nonsense comments
    I am sorry but I don't think any of us can understand what you are trying to ask.  What software?  VBScript is a scripting language that you use to write a script.  It cannot modify a file that is open by another process.
    We posted the suggestion to look into using the FileSystemObject to append a line to a file.  The examples show you how to do this.
    I suspect that the real problem is that, since you don't speak English natively, we are not understanding what you are trying to ask.  I know that, for me, what you are asking doesn't make sense. Another guess is that you have a program that is able
    to use VB to do things.  Is that what you mean by "softwares".  Are you saying that another program is written in VBScript and you want to modify it?
    You have to clarify these things.
    ¯\_(ツ)_/¯

  • How to call DOC file using web.show_documents

    Hi friends ,
    If I use the built-ins web.show_documents for open the *.doc file
    I am getting the following error
    ORA-06550: line 5, column 2:
    PLS-00201: identifier 'README.DOC' must be declared
    ORA-06550: line 5, column 2:
    PL/SQL: Statement ignored
    DAD name: WebDB
    PROCEDURE : readme.doc
    URL : http://132.148.160.3:80/WebDB/readme.doc?
    PARAMETERS :
    ===========
    ENVIRONMENT:
    ============
    SERVER_PORT=80
    SERVER_SOFTWARE=Oracle WebDb Listener 2.1
    SERVER_NAME=132.148.160.3
    GATEWAY_INTERFACE=CGI/1.1
    SERVER_PROTOCOL=HTTP/1.0
    REMOTE_HOST=132.148.160.251
    REMOTE_ADDR=132.148.160.251
    REQUEST_METHOD=GET
    QUERY_STRING=
    SCRIPT_NAME=
    PATH_INFO=/WebDB/readme.doc
    HTTP_ACCEPT=*/*
    HTTP_ACCEPT_LANGUAGE=en-us
    HTTP_ACCEPT_ENCODING=gzip, deflate
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
    HTTP_HOST=132.148.160.3
    HTTP_CONNECTION=Keep-Alive
    Please advice How to call Doc file in web.
    Thanx
    null

    The syntax to execute web.show_document:
    web.show_document('http://server_ip_or_server_name/virtual_path/filename.doc')
    The virtual path has been defined in Apache (if you run on web with Apache) or has been defined in Internet Inoformation Server (if you are runing with Internet Information Server.)
    null

  • Converting docx to doc files using wordconv.exe

    Hello,
    I have a requirement wherein I need to convert the docx files to doc files. I looked around and found the "Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File
    Formats" ("http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en"). Installing this would place a bunch of files in the C:\Program Files\Microsoft Office\Office12\ directory. This folder also contains an executable named "Wordconv.exe" which according to http://www.oooninja.com/2008/02/office-compatibility-pack-review.html converts the docx files to doc files if you use the execute something like the following in the command prompt:-
    "C:\Program Files\Microsoft Office\Office12\wordconv.exe" -oice -nme <input file> <output file>
    I downloaded the compatibility pack and tried the above command. Nothing happens. No error message,no output,nothing. I wonder what is the problem. In the above link,some guys have suggested to download the latest windows updates from Windows.
    Well,I tried this in my Windows XP (with Service Pack 2) and only thing I am left to install in service pack 3. Is that required? This WIndows XP machine does not have the Office 2007 installed. Is it required?
    Also,I tried this on a Windows server 2003 machine which also has the compatibility pack and result is same.This machine does have the Office 2007 installed.
    Am I missing anything? If yes,please let me know as I am kinda stuck in this. I dont want to use a commercial product like "Aspose.Words" for this.
    Is there any other tool available from Microsoft to convert docx to doc files? Please let me know. 
    I am cuurently looking into the Office tools.
    Thanks in Advance,
    Ashish

    Hello!
    I've got the same problem. I've tried to google it, and found this topic.
    Have you found the solution?
    Thanks, Victor.

  • Applescript to print a .doc file using TextEdit with print dialog.

    I want to print a pdf file using TextEdit .
    I want to display the print dialog before doing the print operation.
    Can any one help me with apple scripts to perform this operation.
    We tried to use this script; but when I click Cancel on print dialog. I am getting an error saying "TextEdit got an error: Apple Event Handler failed".
    set printDoc to "Macintosh HD:Users:testuser:Testing:testprint.pdf"
    tell application "TextEdit"
    activate
    open printDoc
    print printDoc with print dialog
    quit saving no
    end tell
    Can anyone help me to fix this issue ?

    Clicking the cancel button in the print dialog is sending an error code back to the script. If you use a try statement you can handle it better. The script below will just ignore it. Or you could use an "on error" statement to do something else.
    set printDoc to "Macintosh HD:Users:testuser:Testing:testprint.pdf"
    tell application "TextEdit"
    activate
    open printDoc
    try
    print printDoc with print dialog
    end try
    quit saving no
    end tell
    Hope that helps. Though the plaintext of a pdf may be a little hard to read.

Maybe you are looking for