[. NET] Creating a very simple document converter-using the component Spire.office

Source: Internet
Author: User
Tags save file silverlight

Create a very simple document converter-using the Components Spire.office directory
    • Spire.office Introduction
    • Library Reference
    • Interface Preview
    • Code Snippets

Spire.office Introduction

About Spire.office, it is a specialized for developers to create, read, write design libraries, convert and print Word document files from. As an independent. NET component, it does not need to install Microsoft Word and other Office software on the machine. However, it can integrate Microsoft's document creation capabilities into any developer's Web application. It is a reliable MS word API that can perform many Word document processing tasks. It supports C #,vb.net,asp.net and ASP. XML, and supports word 97-2003/2007/2010/2013 and can convert them to common file formats such as Xml,rtf,txt,xps,epub and other high-quality conversions Vice versa. It is a component developed from the E-iceblue company.

The following is a brief introduction to the company from the "HPE Control network".

E-iceblue is a. NET, Silverlight, and WPF development control vendor. E-iceblue's goal is to provide customers with high-quality controls to read and write files in different formats. E-iceblue controls are widely used by most of the world's top 500 companies. E-iceblue's major developers have more than 10 years of experience developing high-performance, high-quality. NET, Silverlight, and WPF control technologies. Every day, E-iceblue products help a large number of developers from large/small companies in more than 60 countries to develop and deliver reliable applications to customers from easier, better, faster, and more productive.

Library Reference

I just want to build Word and Excel converters, so only in Nuget installs the ~. Doc and ~. Xls.

Interface Preview

I found that when ~. Doc and ~. When XLS is installed in a class library, an exception occurs when converting some types, so it takes a layered form.

Wordconverter only refers to ~. Doc.

This is a very common kind of a converter to complete the drag control.

Code Snippets

Refining the core conversion code will find that it is relatively simple to use.

1             //Create a Document object2             varDocument =NewDocument ();3 4             //Loading Documents5Document. LoadFromFile ("file name containing the path"); Example: Document. SaveToFile ("Sample.pdf", fileformat.pdf);6             //Save File7Document. SaveToFile ("path containing the file name","type of document format you want to convert");8 9             //Open file, preview operationTenProcess.Start ("file name containing the path");

There is also more support for document format types here, FileFormat enumeration.

1      Public enumFileFormat2     {3         //4         //Summary:5         //Microsoft Word 97-2003 Binary Document.6Doc =0,7         //8         //Summary:9         //Microsoft Word 97-2003 Binary Document or Template.TenDot =1, One         // A         //Summary: -         //Microsoft Word Document. -Docx =2, the         // -         //Summary: -         //Microsoft Word Document -Docx2010 =3, +         // -         //Summary: +         //Microsoft Word Document ADocx2013 =4, at         // -         //Summary: -         //Microsoft Word Template format. -Dotx =5, -         // -         //Summary: in         //Microsoft Word Template format. -Dotx2010 =6, to         // +         //Summary: -         //Microsoft Word Template format. theDotx2013 =7, *         // $         //Summary:Panax Notoginseng         //Microsoft Word macro enabled file format. -DOCM =8, the         // +         //Summary: A         //Microsoft Word macro enabled file format. theDocm2010 =9, +         // -         //Summary: $         //Microsoft Word macro enabled file format. $Docm2013 =Ten, -         // -         //Summary: the         //Microsoft Word macro enabled template format. -DOTM = One,Wuyi         // the         //Summary: -         //Microsoft Word macro enabled template format. WuDotm2010 = A, -         // About         //Summary: $         //Microsoft Word macro enabled template format. -Dotm2013 = -, -         // -         //Summary: A         //PDF Format +PDF = -, the         // -         //Summary: $         //RTF Format theRTF = the, the         // the         //Summary: the         //Xml file format. -XML = -, in         // the         //Summary: the         //Text file format. AboutTXT = -, the         // the         //Summary: the         //Html format. +Html = -, -         // the         //Summary:Bayi         //XPS Format theXPS = +, the         // -         //Summary: -         //EPub Format theEPub = -, the         // the         //Summary: the         //WordprocessingML Format -WordML = +, the         // the         //Summary: the         //Word XML format.94Wordxml = A, the         // the         //Summary: the         //The document is in the Word 6 or Word to the format. Spire.doc does not currently98         //Support loading such documents. AboutDocPre97 = at, -         //101         //Summary:102         //instructs Spire.doc to recognize the format automatically.103Auto = -104}

Just some beginner's code, looks like nothing to say.

Demo:http://git.oschina.net/liqingwen/officeconverter

  

Portal

"Do not say Hello word", read poetry also in vain: Word Operation component Introduction-Spire.doc "

[. NET] Creating a very simple document converter-using the component Spire.office

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.