Export HTML to Word – component for .NET

Elerium Software has introduced a new version of Elerium HTML to Word .NET component
 
July 3, 2013 - PRLog -- Elerium HTML to Word .NET is a fully managed .NET component which enables C#/VB.NET/ASP.NET developers to convert various sources of HTML to Word documents (DOC, DOCX and RTF) from any .NET projects. Elerium HTML to Word .NET allows to convert HTML with full support of CSS styles. Supported output formats: Word 97-2003, Word 2007 and above. It is needed to say that the resulted word document can be edit even after the conversion. The converter includes the powerfull WORD engine that does not rely on other software. In such way, the input HTML document/string can be used as a template for the finish documents.

The installation package of the component contains C# and VB.NET samples for quick start. Base on the samples of Elerium Word .NET component a developer can quickly get the information about main features of the component and understand basic principles of Word Api programming.

Elerium HTML to Word .NET is an independent .NET component that compatible with .NET 2.0 and higher and does not depend on third-party libraries and Microsoft Office Automation.

Key Features:
- Various sources of HTML: file/string/stream/url.
- Generate and save Word documents (Word 97-2003, Word 2007+).
- Full support of internal and external CSS styles.
- Page formatting (margins, width, height, orientation etc.).
- Paragraph formatting (line spacing, background, margins, borders, etc.).
- Text formatting (Bold, italic, color, etc.).
- HTML tables, embedded tables and their properties.

How to use this component? It is very easy. The developer must perform three simple steps:
1. Add Elerium Word .Net component to the solution. Simply put Word.dll into /bin folder of the project.
2. Initialize the Docs.Word instance.
3. Call the conversion method.

For example, let’s take the html file and convert it to a docx format. Additionally change the parameters of the output document.

C# code:

using System;
using System.Collections.Generic;
using Docs.Word;

namespace ConverterSample3
{
class Program
{
static void Main(string[] args)
{
// Define the names of source and result files
string SourceFileName = "TestFile.html";
string OutputFileName = "ResultFile.docx";

// Change convert options
Converter.Options.PageHeight = 700;
Converter.Options.PageWidth = 300;
Converter.Options.LeftMargin = 50;
Converter.Options.RightMargin = 30;

// Convert from HTML to DOCX (output format can be changed)
Converter.ConvertHtmlToDoc(SourceFileName, OutputFileName, DocumentFormat.DOCX);
}
}
}

VB.NET code:

Imports Docs.Word

Module Module1
Sub Main()
' Define names of source and result files
Dim SourceFileName As String = "TestFile.html"
Dim OutputFileName As String = "ResultFile.docx"

' Change convert options
Converter.Options.PageHeight = 700
Converter.Options.PageWidth = 300
Converter.Options.LeftMargin = 50
Converter.Options.RightMargin = 30

' Convert from HTML to DOCX (output format can be changed)
Converter.ConvertHtmlToDoc(SourceFileName, OutputFileName, DocumentFormat.DOCX)
End Sub
End Module

About Elerium Software

Elerium Software develops professional solutions for use in .NET projects (C#, VB.NET, ASP.NET) that aimed to read/write/convert different office/web documents and formats. Elerium Software components are based on the unique design and fast algorithms that allow being independent from the third-party applications and libraries.

For more information about the component please visit the product page:
http://www.eleriumsoft.com/Word_NET/HTML2WORD/Default.aspx
End
Source: » Follow
Email:***@eleriumsoft.com Email Verified
Tags:HTML to Word, Net, c, Asp Net, Vb Net
Industry:Computers, Software
Location:luzern - Switzerland
Account Email Address Verified     Account Phone Number Verified     Disclaimer     Report Abuse
Elerium Software PRs
Trending News
Most Viewed
Top Daily News



Like PRLog?
9K2K1K
Click to Share