---
title: "Convert a Document in C#"
---

```

## Purpose Summary

This page describes the general workflow for converting documents between different formats and highlights key considerations for successful conversions.

```

The ability to easily and reliably convert documents from one format to another is one of the main feature areas of Aspose.Words. Such a conversion is nothing more than a combination of loading and saving operations.

## What Is Document Conversion {#what-is-document-conversion}

Almost any task that you want to perform with Aspose.Words involves loading or saving a document in some format. As mentioned in previous sections, the [LoadFormat](https://reference.aspose.com/words/net/aspose.words/loadformat/) enumeration specifies all *load* or *import* formats supported by Aspose.Words, and the [SaveFormat](https://reference.aspose.com/words/net/aspose.words/saveformat/) enumeration specifies all *save* or *export* formats supported by Aspose.Words. Thus, Aspose.Words can convert a document from any supported load format into any supported save format. As a rule, such a conversion requires several stages of calculation. However from the user perspective conversion from a document format to another one is itself very simple, and can be accomplished with just two steps:

1. Load your document into a [Document](https://reference.aspose.com/words/net/aspose.words/document/) object using one of its constructors.
1. Invoke one of the [Save](https://reference.aspose.com/words/net/aspose.words/document/save/#save/) methods on the **Document** object and specify the desired output format.

```

**Try online**

You can try the conversion functionality by using our [Free online converter](https://products.aspose.app/words/conversion) tool.

```

## Popular Conversions {#popular-conversions}

The current section describes popular conversions, as well as ideas for working with some combinations of formats when loading and saving. Using the examples of this section, you can understand that the conversion process itself is quite universal, and there is no point in describing all the possible options, since there are several hundred of them due to the large number of [formats supported by Aspose.Words for .NET](/words/net/supported-document-formats/).

```

Please note that below are the most popular conversion combinations, and not every combination is linked to the definite page. This is the case because our articles do not have examples for every pair of conversions - almost all conversions are pretty similar. Make sure of this by studying the articles in the current section.

```

<div class="row">
	<div class="col-md-4">
		<h2>Convert Word to PDF</h2>

				/words/net/convert-a-document-to-pdf/#converting-doc-or-docx-to-pdf - Convert DOC to PDF
				/words/net/convert-a-document-to-pdf/#converting-doc-or-docx-to-pdf - Convert DOCX to PDF
				and others

		<h2>Convert Image to PDF</h2>

				/words/net/convert-a-document-to-pdf/#convert-an-image-to-pdf - Convert JPG to PDF
				/words/net/convert-a-document-to-pdf/#convert-an-image-to-pdf - Convert TIFF to PDF
				and others

    <h2>Convert Web to PDF</h2>

				Convert Markdown to PDF
				Convert HTML to PDF
				Convert MHT (MHTML) to PDF
				and others

		<h2>Convert Other Formats  to PDF</h2>

				Convert RTF to PDF
				Convert ODT to PDF
				Convert TXT to PDF
				Convert Mobi to PDF
				and others

	<div class="col-md-4">
		<h2>Convert PDF to Word</h2>

				/words/net/convert-pdf-to-other-document-formats/ - Convert PDF to DOCX
        Convert PDF to DOC
				and others

		<h2>Convert PDF to Image</h2>

				/words/net/convert-a-document-to-an-image/ - Convert PDF to JPG
        Convert PDF to SVG
				and others

		<h2>Convert PDF to Web</h2>

        Convert PDF to Markdown
				Convert PDF to HTML
				Convert PDF to EPUB
				and others

		<h2>Convert PDF to Other Formats</h2>

				Convert PDF to RTF
				Convert PDF to XPS
				and others

	<div class="col-md-4">
		<h2>Convert a Document to an Image</h2>

				/words/net/convert-a-document-to-an-image/ - Convert PDF to JPG
				/words/net/convert-a-document-to-an-image/ - Convert DOCX to JPG
				and others

		<h2>Convert a Document to Markdown</h2>

				/words/net/convert-a-document-to-markdown/ - Convert a Document to Markdown
				Convert HTML to Markdown
				and others

		<h2>Convert a Document to HTML</h2>

				/words/net/convert-a-document-to-html-mhtml-or-epub/#convert-a-document - Convert Word to HTML
				Convert Markdown to HTML
				Convert Mobi to EPUB
				and others

		<h2>Work a Document in a Database</h2>

				/words/net/serialize-and-work-with-a-document-in-a-database/ - Serialize and Work with a Document in a Database

		<h2>Other Examples</h2>

				/words/net/convert-a-document-to-mhtml-and-send-it-by-email/ - Convert a Document to MHTML and Send It by Email
				Convert DOCX to DOC
				Convert HTML to Word
				and others

## Related APIs

- [Document](https://reference.aspose.com/words/net/aspose.words/document/)
- [LoadFormat](https://reference.aspose.com/words/net/aspose.words/loadformat/)
- [SaveFormat](https://reference.aspose.com/words/net/aspose.words/saveformat/)
- [PdfSaveOptions](https://reference.aspose.com/words/net/aspose.words.saving/pdfsaveoptions/)

------

## FAQ

1. **Q:** Do I need a license to convert documents with Aspose.Words for .NET?
   **A:** No, you can perform conversions using the free evaluation version, but the output will contain a watermark. To remove the watermark and unlock all features, apply a valid Aspose.Words license using `License license = new License(); license.SetLicense("Aspose.Words.lic");`.

2. **Q:** Which file formats can I load and save with Aspose.Words?
   **A:** Aspose.Words supports over 100 formats. Loading is governed by the `LoadFormat` enumeration (e.g., DOC, DOCX, ODT, RTF, HTML, MHTML, TXT, MD). Saving uses the `SaveFormat` enumeration (e.g., PDF, XPS, EPUB, HTML, MHTML, PNG, JPEG, TIFF, DOCX, DOC). See the **Supported Document Formats** page for the full list.

3. **Q:** How can I convert a document that is stored in a `Stream`?
   **A:** Use the `Document` constructor that accepts a `Stream`, then call `Save` with the desired format. Example:

   ```csharp
   using (FileStream inputStream = File.OpenRead("input.docx"))
   {
       Document doc = new Document(inputStream);
       using (FileStream outputStream = File.Create("output.pdf"))
       {
           doc.Save(outputStream, SaveFormat.Pdf);
       }
   }
   ```

4. **Q:** How do I create a PDF that complies with PDF/A or PDF/UA standards?
   **A:** Use `PdfSaveOptions` and set the appropriate compliance property before saving. Example:

   ```csharp
   Document doc = new Document("input.docx");
   PdfSaveOptions options = new PdfSaveOptions();
   options.Compliance = PdfCompliance.PdfA1b;   // or PdfCompliance.PdfUa
   doc.Save("output.pdf", options);
   ```