Java exporting Word documents with Itext

Source: Internet
Author: User

1. jar packages that need to be imported

2. Exporting word and downloading is actually two-step.

The first step is to export (upload) the data that needs to be exported to the server

The second step is to download the documents on the server to the local

3.

The first step. Uploading documents

(1) Setting the response information and constructing the upload path

(2) Set the font style to create the object that generated the document

(3) Wordutils Tool Class

(4) Writing the document title

(5) The directory in which the document is written and the contents of the document are available in the tool class above. It's not glued to the picture, but keep in mind that after the document is finished, you call Us.closedocument (); The method is finished, otherwise the document content is empty.

(6) In fact, the difficulty lies in the document directory structure of the display, by the way before the code to stick, for reference (code sticky There is a repetition, a little messy, look at it. Because in the development environment of the code, not to take outside)

The second step. Download

Download will not say, and ordinary download the same, will not be able to find the Niang.

Java exporting Word documents with Itext

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.