Convert Word Documents in C#

Convert Word Documents in C#

Convert Word documents in C# with a high-performance format conversion REST API. Create, combine, integrate document conversions of any type and scale into your systems to create workflows specific to your business tasks.

Aspose document conversion platform provides maximum performance and allows converting Word, OpenOffice, PDF, HTML, Markdown, E-Mail, Postscript, plain text and other documents in any direction with top quality and high speed. With .NET SDK you have 24/7 access to a full range of Document Automation and Conversion features, required by C# developers to implement their document-processing solutions.

Our Cloud SDKs are available for all major operating systems (Windows, macOS, Linux, Android), favorite programming languages (Java, C#, C++, Python, Node.js, PHP, Golang, Ruby, Swift), Java and .NET frameworks.

Supported Document Formats

Almost all mainstream document formats are supported, including DOCX, DOC, RTF, ODT, PDF, HTML, MD, XAML, TXT, PNG, JPG and many others. The complete list of supported file formats is presented in the Cloud Documentation.

Words Cloud API supports conversions of multiple documents, conversion of Word documents from the outdated DOC format to the latest DOCX and in the opposite direction.

Convert Word Documents using C# library

Aspose Cloud provides a powerful document conversion C# library, designed to convert Word documents in C# to and from Word-based formats, and also supports documents in various OpenOffice formats, E-Mail formats, PDF, HTML, Markdown, Postscript, XAML and plain text.

Convert PDF to Word in C#

Aspose Words helps you to get the most of PDF and Words documents and use them in conjunction with each other. According to your document automation tasks, you may require to convert a write-protected PDF to an editable DOCX or DOC with formatting and content identical to the original PDF.

You can easily convert PDF to DOC with our C# library. Aspose Cloud API allows converting PDF to various Word-based document formats, including DOCX, RTF and ODT.

If you need to extract text from a PDF document, just convert it to plain text with PDF to TXT conversion.

See also:

Convert Word to PDF in C#

There are several reasons why you may need to convert a Word document to PDF format. Here are some of them:

  • PDF is write-protected and you can confidently share it with others.
  • PDF offers better security options than a Word document.
  • PDF is perfect for long-term archiving.
  • PDF is optimized for professional printing.

You can easily convert Word to PDF with C# library. The output document will conform to the "PDF 1.5" or "PDF/A-1b" specification.

If you need to extract text from a Word document, just convert it to plain text with DOCX to TXT conversion.

Convert MOBI to EPUB

The increasing mainstream prominence of electronic books gives rise to a number of lightweight eBook formats, where MOBI and EPUB are the most popular. They are cross-platform and provide reflowable content. Like HTML they can adjust page representation in accordance with characteristics of the specific e-reader.

With .NET SDK you can easily convert MOBI to EPUB format. EPUB has greater support across all platforms, whereas MOBI is mainly an Amazon Kindle e-reader format.

Try our free online MOBI to EPUB eBook Converter.

Convert MOBI to PDF

PDF is also widely accepted as an eBook format. With .NET SDK you can convert eBook from MOBI format to more versatile PDF with ease.

Also, have a look at our online MOBI to PDF Converter. It is 100% free.

Convert Word to EPUB in C#

With .NET SDK you can convert DOCX to EPUB, which is a widespread electronic book format. The original document content, formatting, images, hyperlinks and navigation would be fully compatible and operational in any electronic book reader.

Convert Word to Image in C#

There is no built-in option in Microsoft Office to save a Word document as a set of images. Using Aspose C# library you can easily convert DOCX to JPG, DOCX to PNG or any other image format.

Conversion supports both raster (JPG, GIF, PNG, etc.) and vector image formats (SVG, EMF, etc.).

Convert Word to HTML in C#

.NET SDK provides an easy way to instantly convert Word document into perfect Web documents. Easily convert DOCX to HTML, Markdown, MHTML and other popular Web formats.

Getting Started with C# library

How to Convert a DOCX in C#

  1. Go to the Aspose Cloud Dashboard.
  2. Create a new Account to access all applications and services or Sign In to your account.
  3. Click on Applications in the left menu to get Client Id and Client Secret.
  4. Check API Reference page for the description of APIs parameters.
  5. Install NuGet package or use the direct download.
  6. Check Developer Guide to convert DOCX to PDF, EPUB, JPG, etc.

Convert documents in C#
var appKey = "##################";
var appSid = "####-####-####-####-####";
var wordsApi = new WordsApi(appKey, appSid);

// Convert PDF to Word
var request = new ConvertDocumentRequest(File.OpenRead("sample.pdf"), "docx");
var result = wordsApi.ConvertDocument(request);
using (var file = new FileStream("sample.docx", FileMode.Create, FileAccess.Write))
{
    result.CopyTo(file);
}

// Convert DOCX to PDF if we have a document in the Storage
var saveOptions = new SaveOptionsData()
{
    FileName = "dest.pdf",
    SaveFormat = "pdf"
};
var request = new SaveAsRequest("sample.docx", saveOptions);
wordsApi.SaveAs(request);

// Convert DOCX to HTML with advanced options
var htmlFixedOptions = new HtmlFixedSaveOptionsData()
{
    ExportEmbeddedCss = true,
    ExportEmbeddedImages = true,
    CssClassNamesPrefix = "aspose_",
    PageIndex = 2,
    PageCount = 3,
    JpegQuality = 90,
    FileName = "dest.html",
    SaveFormat = "html"
};
var request = new SaveAsRequest("source.docx", htmlFixedOptions);
wordsApi.SaveAs(request);


  

Support and Learning Resources