Specifying page parameters in an MS Word Doc using JSP

Hi all,
I have a JSP page which generates data and allows the user to open a Word Document with the generated data in it. I'm trying to figure out if there is a way to change the Page Setup parameters for the document. For example, I'd like a document that has 1 inch margins all around and uses a Landscape layout instead of Portrait.
The user could just as easily change these parameters in Word after the document is open and save it to their hard drive, but I'd like to make things as simple for them as possible. Can I somehow pass my preferences to the Word document through the .jsp page that generates it?
Thanks!

Never mind, I figured it out :)
I put this in the <head> tag in the HTML of the .jsp:
<style>
   @page Section1
   {size:11.0in 8.5in;
   margin:1.0in 1.0in 1.0in 1.0in;
   mso-page-orientation: landscape;
   mso-paper-source:0;}
   div.Section1
   {page:Section1;}
</style>And I put a div tag around the body of the document:
<div class="Section1">
</div>

Similar Messages

  • How do I set Pages to automatically open all Word (.doc) documents?

    Being a relatively new Mac User, I haven't yet figured out how to associate programs with particular file types.
    How do I set Pages to automatically open all Word (.doc) documents?
    Thanks.

    Hello Argelius
    If you select a word file in the Finder and do File>Get Info you will see a section in there where you can specify which application should be used to open files of that type.

  • 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.

  • Is "pages" app really compatible to word .doc files?

    i tried opening word files with the pages yet it said that it was not compatible. i then had to open the file with another app in other to see it. i made a new file with pages and sent it via my email. i was not able to open it with the microsoft documents yet the description of the app said that it was compatible. How is this?

    What version of Pages?
    What version of Word?
    What was the file format?
    You didn't send a .pages file to the PC?
    PCs do not have Pages and can not open .pages files. You need to Export to Word .doc instead.
    Peter

  • Trying to convert a pdf to a word doc using Acrobat XI Pro. I am getting formatting errors and scrambled text, especially right below headings. Not all headings affected, just some, but all the same paragraph tag. Any ideas?

    I am trying to convert a pdf  to a word doc. The pdf was created in Framemaker. I am using Acrobat XI Pro and getting formatting errors and scrambled (or missing) text, especially below a heading. Any fixes?

    Hi pakbecker,
    Please try updating to Acrobat 11.0.7 and check.
    In case you still face issues,  i would like to have a look at th doucment.
    Send me an email at [email protected]
    Regards,
    Rave

  • How can Hebrew letters in a pdf file be reproduced with Hebrew as a word doc using adobe export pdf?

    I subscribe to Adobe Export PDF and it has worked well. Today I uploaded a PDF file with Hebrew letters and the downloaded Word doc did not format the Hebrew letters as Hebrew letters. Is there a way around this?
    TYIA
    John

    Try Goodreader in the App Store. It should do the job for you.

  • Printing a microsoft word doc using Java Print API

    Hi,
    I have to print a microsoft word doc.I am using Java Print API, but the code is printing only Hashcodes instead of the actual document.
    Here is the code. Please let me know whats wrong in it.
    CODE:::
    public String print() throws Exception {
    String realPath = getRealPath("/images/formLibrary/csaAddressContactRequestForm100.doc");
    PrintRequestAttributeSet pras1 = new HashPrintRequestAttributeSet();
    DocFlavor flavor1 = DocFlavor.INPUT_STREAM.AUTOSENSE;
    PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
    DocPrintJob job = defaultService.createPrintJob();
    FileInputStream fis1 = new FileInputStream(realPath);
    DocAttributeSet das = new HashDocAttributeSet();
    Doc doc1 = new SimpleDoc(fis1, flavor1, das);
    job.print(doc1, pras1);
    Thread.sleep(10000);
    System.exit(0);
    return "";
    }

    By using an appropriate library. JText, whatever.
    Google, man.I think Rene meant iText!Whatever. :) Never used it, I just remembered there was something named like that. Thanks.

  • PDF/X-1a from a Word doc. using Acrobat 9.5.2 Standard?

    Can I create a PDF/X-1a file from a Microsoft Word document using my copy of Acrobat 9.5.2 Standard?

    You say the setting does not work. What happens?

  • In Pages - How do I delete a page number from an imported Word doc?

    I was sent an email with a six page WORD document attached. The attachment opened in Pages. Most of it is good, but there are page number characters in the wrong place.  I cannot do anything to them. They seem to be outside the document text, off to the right side and only partially showing. Definitely not at the bottom where they should be seen. Going over them with the cursor does not allow me to select and delete these numbers.  I thought they might be in footnote format and in the Inspector I unchecked Header and Footnote, which did nothing to help. 
    Also, I've tried without success to just go and add my own page numbers which might work, but then will need white-out or similar to remove the old page number.
    Working in Text and PDF format did not work, either, and I do not have Word.
    Unfortunately, I've spent hours on this and really hope somebody has a good suggestion on how to deal with these characters.
    Thanks

    Just to clarify, once you have done this you still need to use the command key and 'lasoo' the object from off the edge. So full process (in version '09 4.3) is
    Format > Advanced > Make Master Objects Selectable
    Then put your mouse to the edge of the page, press CMD key and drag to select the offending item. Then it will appear with a box around and can be deleted.
    Thanks to all who posted these tips - I was pulling my hair out over a client document!

  • Pages won't open a Word doc

    I saved a Pages '09 version 4.0 document as Word on my wife's MacBook Air, OS 10.6.8.  I now get an error message saying that Pages can't open this document.  It will open in TextEdit, why not in Pages?

    Apple has the iWork 9.1 updater if you are on OS X 10.6.8, or Lion (10.7.3 or less). The iWork 9.3 updater requires OS X 10.7.4 or later, and provides the last update to the iWork '09 DVD applications (e.g. Pages v4.3, Numbers 2.3, and Keynote 5.3).

  • How do I open a word doc using Pages?

    I am new to Macs and I have no idea how to open a word document in Pages. I really do not want to keep Windows or Word on the mac so if there is any way to keep Windows off my computer please help.

    Welcome to Apple Discussions
    If you want to always open Word documents with Pages, you can set OS X to do that. Highlight a known Word document in the Finder, highlight it & choose Get Info from the File menu. In the Get Info box, click the triangle next to "Open With." Click on this drop-down menu & choose Pages. If Pages is not a choice, choose "Other" & navigate to the Pages application. Now click the "Change" button under the text that asks if you want to open all documents like this with Pages. You can then double-click the Word documents & they will open in Pages. Note that the icon for the Word files will have a plain, white icon.

  • How can I select pages to print from a Word document using the report generation 'print report' vi?

    I have researched the knowledge base and found:
    Printing A Range of Pages or Number of Copies of a Report Using the Report Generation Toolkit in LabVIEW.
    This seems to be from a previous version of LV. I am using LV2010. The instructions given do not match up with the current vi. The information did provide a tip and drilling down into  the vi I was able to insert the from/to page numbers at the printout invoke method, however this prevents the print function from working in that it can no longer find the default printer.
    The error message is:
    Error 1015 occurred at NI_ReportGenerationToolkit.lvlib:Word_Print.vi -> NI_Word.lvclassrint Report.vi ->
    error 1015 is: Printer is not responding. Check printer configuration.
    Any ideas how I can make the modification to print, for example, pages 24 through 29 out of a 32 page word document?
    Thanks,
    Chris

    Hello, take a look at this article. Unfortunately the Generate Report Get Data to Modify.vi was remove since RGT 1.1.3 release. That being said, we can try to find a workaround. See "Configuring a Printer Through the Windows Dialog in LabVIEW", open the GetPrinterSettings.vi, at the PrinterSettings property node you can select the from/to page. I hope this helps.
    Alejandro | Academic Program Engineer | National Instruments

  • How to view Word DOC using Word Viewer

    I am a new administrator for a SharePoint 2010 farm with 10s of GB of Microsoft Word documents, most of which are in Word 97-2003 DOC format.  I have recently configured the Word Viewing service and can of course view Word 2010 documents saved
    to the farm, but how to get the legacy archive of DOCs viewable using Word Viewing as well?
    From all that I have read, OWA only works for Office 2010 documents.  Is there any tweak available to get it to be able to view older formatted Word documents also in the browser?
    Baring this, are there batch conversion utilities available?  I have searched and found some
    here and here, but am seeking more robust solutions.
    I would be interested in learning about what other administrators have done to resolve similar problems.
    Sincerely,
    Steve

    Hi Steve,
    I understand that the error occurred when you open the word files.
    I recommend to delete the cache files for the corresponding web aaplication using PowerShell.
    Go to Central Administration > Application Management > View all site collections > select the web application and then check for site collection with URL /sites/Office_Viewing_Service_Cache and make sure it is there. Then open http://{webapp url}/sites/Office_Viewing_Service_Cache
    and you will see the cached
    files of this web application.
    You can also add the entry below in web.config to see if the issue still occurs:
    <compilation optimizeCompilations="true">
    More information:
    http://kancharla-sharepoint.blogspot.in/2013/08/sharepoint-word-web-app-cannot-open.html
    I also recommend to check the event log and ULS log to see if anything unexpected occurred.
    To check event log, click the Start button and type “Event Viewer” in the Search box.
    For SharePoint 2010, by default, ULS log is at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Access microsoft word doc using java

    how can i access microsoft word using java .
    I want to select text from the word in the same format as it is.
    if possible can u all help me

    By using an appropriate library. JText, whatever.
    Google, man.I think Rene meant iText!Whatever. :) Never used it, I just remembered there was something named like that. Thanks.

  • Search for a String within a document (Word, txt, doc) using JSP, JAVA

    Hi
    I have created a little application that uses combination of JSP and HTML. Users of this application can upload documents which are then stored on the server. I need to develop functionality where I can allows users to search for a string within a document. More precisely, user would type in some string in a text box and application will search all uploaded documents for that string and return the downloadable links to those documents that contains that string. I have never done this before. I was wondering if someone could get me started on this or point me to some thread where this idea is already discussed. Any Jave code exists for searching through documents??
    Thanks for your help
    Riz

    http://www.ibm.com/developerworks/java/library/j-text-searching.html
    http://en.wikipedia.org/wiki/Full_text_search
    Type these parameter in yahoo:+efficient text search
    you will need something like openoffice library to read microsoft word document.

Maybe you are looking for