Spire.doc, spire.doc generates the table

Source: Internet
Author: User

Spire.doc, spire.doc generates the table

First of all, I would like to thank Jack for his trust in me. Let me write an evaluation. I am sorry for Jack, because I am dull and have been nervous about my projects recently, the evaluation task has been taken away for a month. As it may be busier in the future, only one small program can be written for testing tonight.

Spire series Word, PDF, Excel, Presentation is a set of controls designed for. NET developers. With this tool, programmers can generate, read, edit, modify, and convert Office files and PDF files on any. NET platform without installing MS Office.

When Jack sent me an email, the content in the red text was the last one that impressed me the most. We do not need to install MS Office. We all know that, office is very large, and it is best if you do not need Office.

However, during the process of writing a small example, it is found that a common DLL of a DOC template must be opened before the content can be written. That is to say, it is not possible without a template. On the other hand, if only WPS is installed on my machine, it can also be used for Word development (of course, this is my illusion and there is no actual test .)

First look at the effect

As The DLL file for The test version is sent to me, "Evaluation Warning: The document was created with Spire" is displayed on The generated Word. doc. NET. the red-letter prompt is not very important. The following table shows how to use Spire. doc. dll generated.

Due to my ignorance, the first time I created a project, I did not reference the Spire. Doc and Spire. License files at the same time, so the project error caused me a lot of trouble for Jack.

I personally feel that compared with Office, Spire is very convenient to use. To display the Header, you only need to add the Header array for a loop. The content is almost the same, so I will not write it.

TableRow row = table. rows [0]; row. isHeader = true; row. height = 25f; for (int I = 0; I When saving Word, you can directly call a save method SaveToFile under Document.

public void SaveToFile(string fileName, FileFormat fileFormat);

I personally think it is convenient that FileFormat provides an enumeration of file formats, which allows developers to easily choose from. Of course, if you provide a front-end selection page, you can also choose

Public enum FileFormat {// Summary: // Microsoft Word 97-2003 Binary Document. doc, /// Summary: // Microsoft Word 97-2003 Binary Document or Template. dot, /// Summary: // Microsoft Word 2007 Document. docx, /// Summary: // Microsoft Word 2010 Document Docx2010, /// Summary: // Microsoft Word 2013 Document Docx2013, /// summary: // Microsoft Word 2007 Template format. dotx, /// Summary: // Microsoft Word 2010 Template format. dotx2010, /// Summary: // Microsoft Word 2013 Template format. dotx2013, // Summary: // Microsoft Word 2007 macro enabled file format. docm, /// Summary: // Microsoft Word 2010 macro enabled file format. docm2010, /// Summary: // Microsoft Word 2013 macro enabled file format. docm2013, // Summary: // Microsoft Word 2007 macro enabled template format. dotm, /// Summary: // Microsoft Word 2010 macro enabled template format. dotm2010, /// Summary: // Microsoft Word 2013 macro enabled template format. dotm2013, /// Summary: // PDF format PDF, /// Summary: // Rtf format Rtf, /// Summary: // Xml file format. xml, // Summary: // Text file format. txt, /// Summary: // Html format. html, // Summary: // XPS format XPS, /// Summary: // EPub format EPub, /// Summary: // WordprocessingML format WordML, //// Summary: // Word xml format. wordXml, // Summary: // The document is in the Word 6 or Word 95 format. spire. doc does not currently // support loading such events. docPre97, /// Abstract: // Instructs Spire. doc to recognize the format automatically. auto}

It's time to go to bed. Let's write it here. Sorry, Jack. My language is too poor.

 

Related Article

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.