---
title: "Convert any file to DOCX, XLSX, PPTX in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/conversion/any-file-to-office/"
md_url: "https://www.nutrient.io/guides/dotnet/conversion/any-file-to-office.md"
last_updated: "2026-05-26T07:56:07.411Z"
description: "Discover how to convert PDF, HTML, and RTF files to DOCX, XLSX, and PPTX formats with our comprehensive guide and expert tips."
---

# Convert to MS Office from any file in C#

### Overview

[Overview](https://www.nutrient.io/guides/dotnet/conversion/to-office.md)

### PDF to DOCX

[PDF to DOCX](https://www.nutrient.io/guides/dotnet/conversion/pdf-to-word.md)

### PDF to XLSX

[PDF to XLSX](https://www.nutrient.io/guides/dotnet/conversion/pdf-to-excel.md)

### PDF to PPTX

[PDF to PPTX](https://www.nutrient.io/guides/dotnet/conversion/pdf-to-powerpoint.md)

### HTML to DOCX

[HTML to DOCX](https://www.nutrient.io/guides/dotnet/conversion/html-to-word.md)

### RTF to DOCX

[RTF to DOCX](https://www.nutrient.io/guides/dotnet/conversion/rtf-to-docx.md)

### Any File to Office

[Any File to Office](https://www.nutrient.io/guides/dotnet/conversion/any-file-to-office.md)

Nutrient.NET SDK (formerly GdPicture.NET) supports converting 100+ file types to Word, Excel, or PowerPoint.

## 100+ supported input file types

- MS Office (Word, Excel, PowerPoint)

- PDF, PDF/A

- HTML, MHT, MHTML

- Email (MSG, EML)

- Images (raster and vector)

- Text (TXT and RTF) and OpenDocument (ODT)

- CAD (DWG, DXF)

- RAW Camera Image Formats (3FR, ARW, BAY, etc.)

For more information, refer to the [full list of supported file types](https://www.nutrient.io/guides/dotnet/about/file-type-support.md).



## Converting PDF to MS Office

To convert PDF files to MS Office, refer to our separate [PDF-to-Word](https://www.nutrient.io/guides/dotnet/conversion/pdf-to-word.md), [PDF-to-Excel](https://www.nutrient.io/guides/dotnet/conversion/pdf-to-excel.md), and [PDF-to-PowerPoint](https://www.nutrient.io/guides/dotnet/conversion/pdf-to-powerpoint.md) guides.

## Converting other file types to MS Office

To save a file to Word, Excel, or PowerPoint format, first use the [`SaveAsPDF` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~SaveAsPDF.html) of the [`GdPictureDocumentConverter` class](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter.html) to convert it to PDF. Then use the [`SaveAsDOCX` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~SaveAsDOCX.html) to convert it to a DOCX, the [`SaveAsXLSX` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~SaveAsXLSX.html) to convert it to XLSX, or the [`SaveAsPPTX` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~SaveAsPPTX.html) to convert it to PPTX.

The `SaveAsPDF` method uses the following parameters:

- `Stream`, or the overload `FilePath` — A stream object where the current document is saved to as a DOCX file. This stream object must be initialized before it can be sent into this method, and it should stay open for subsequent use. If the output stream isn’t open for both reading and writing, the method will fail, returning the `GdPictureStatus.InvalidParameter` status, which is the file path where the converted file will be saved. If the specified file already exists, it’ll be overwritten. You have to specify a full file path, including the file extension.

- `Conformance` — A member of the [`PdfConformance` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.PdfConformance.html). This specifies the required conformance to the PDF or PDF/A standard of the saved PDF document. You can use the value of `PdfConformance.PDF` to save the file as a common PDF document.

The `SaveAsDOCX`, `SaveAsXLSX`, and `SaveAsPPTX` methods use the following parameter:

- `Stream`, or the overload `FilePath`

Note that the output stream should be open for both reading and writing and closed/disposed of by the user once processing is complete using the [`CloseDocument` method](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~CloseDocument.html).

## How to convert any file to MS Office

1. Create a `GdPictureDocumentConverter` object.

2. Convert the source file to PDF with [`GdPictureDocumentConverter.SaveAsPDF(Stream, PdfConformance)`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~SaveAsPDF.html). Recommended: Specify the source document format with a member of the [`DocumentFormat`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.DocumentFormat.html) enumeration.

3. Load the newly generated PDF file by passing its path to the [`LoadFromFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~LoadFromFile.html) method (this method only supports PDF documents).

4. Save the PDF file as a DOCX using `SaveAsDOCX`, as an XLSX using `SaveAsXLSX`, or as a PPTX using `SaveAsPPTX`.

The following example converts and saves an RTF document to a DOCX file (it can also be saved as a stream):

### C#

```csharp

using GdPictureDocumentConverter converter = new();

using Stream inputStream = File.Open(@"input.rtf", System.IO.FileMode.Open);
using Stream outputStream = new MemoryStream();

GdPictureStatus status = converter.ConvertToPDF(inputStream, GdPicture14.DocumentFormat.DocumentFormatRTF, outputStream, PdfConformance.PDF1_5);
if (status!= GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}

status = converter.LoadFromStream(outputStream);
if (status!= GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}

status = converter.SaveAsDOCX("output.docx");
if (status!= GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}

Console.WriteLine("The input document has been converted to a docx file");

```

#### See also

- [`DocxImageQuality Property`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~DocxImageQuality.html)

- [`GdPictureDocumentConverter Class`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter.html)

- [`GdPictureDocumentConverter Members`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter_members.html)

- [`CloseDocument Method`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~CloseDocument.html)

- [`RasterizationDPI Property`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~RasterizationDPI.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Optional file type configuration properties

The following file types have optional configuration properties for greater precision:

- [HTML](https://www.nutrient.io/guides/dotnet/conversion/html-to-word.md#optional-html-configuration-properties)

- [Email](https://www.nutrient.io/guides/dotnet/conversion/email-to-pdf.md#optional-configuration-properties)

- [JBIG2](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~JBIG2PMSThreshold.html)

- [TXT](https://www.nutrient.io/guides/dotnet/conversion/text-to-pdf.md#optional-configuration-properties)

- [TIFF](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentConverter~TiffEnableExifRotate.html)

- [Excel](https://www.nutrient.io/guides/dotnet/conversion/excel-to-pdf.md#optional-configuration-properties-2)

## Optional PDF configuration properties

Optionally, configure the conversion with the following properties of the `GdPictureDocumentConverter` object:

- [`PdfBitonalImageCompression`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~PdfBitonalImageCompression.html) is a member of the `PdfCompression` enumeration that specifies the compression scheme used for bitonal images in the output PDF file.

- [`PdfColorImageCompression`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~PdfColorImageCompression.html) is a member of the `PdfCompression` enumeration that specifies the compression scheme used for color images in the output PDF file.

- [`PdfEnableColorDetection`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~PdfEnableColorDetection.html) is a Boolean value that specifies whether to use automatic color detection during the conversion that preserves image quality and reduces the output file size.

- [`PdfEnableLinearization`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~PdfEnableLinearization.html) is a Boolean value that specifies whether to linearize the output PDF to enable Fast Web View mode.

- [`PdfImageQuality`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~PdfImageQuality.html) is an integer from 0 to 100 that specifies the image quality in the output PDF file.

The example below creates a PDF document from an RTF file with a custom configuration:

### C#

```csharp

using GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter();
// Load the source document.
gdpictureDocumentConverter.LoadFromFile(@"C:\temp\source.rtf", GdPicture14.DocumentFormat.DocumentFormatRTF);
// Configure the conversion.
gdpictureDocumentConverter.PdfColorImageCompression = PdfCompression.PdfCompressionJPEG;
gdpictureDocumentConverter.PdfImageQuality = 50;
// Save the output in a new PDF document.
gdpictureDocumentConverter.SaveAsPDF(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
    ' Load the source document.
    gdpictureDocumentConverter.LoadFromFile("C:\temp\source.rtf", GdPicture14.DocumentFormat.DocumentFormatRTF);
    ' Configure the conversion.
    gdpictureDocumentConverter.PdfColorImageCompression = PdfCompression.PdfCompressionJPEG
    gdpictureDocumentConverter.PdfImageQuality = 50
    ' Save the output in a new PDF document.
    gdpictureDocumentConverter.SaveAsPDF("C:\temp\output.pdf")
End Using

```

#### Used methods and properties

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~LoadFromFile.html)

- [`PdfColorImageCompression`]

- [`PdfImageQuality`]

- [`SaveAsPDF`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureDocumentConverter~SaveAsPDF.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Convert any image to PDF in C#](/guides/dotnet/conversion/any-image-to-pdf.md)
- [Convert bitmap (BMP) to PDF in C#](/guides/dotnet/conversion/bmp-to-pdf.md)
- [Convert DWG or DXF to PDF in C#](/guides/dotnet/conversion/cad-to-pdf.md)
- [Embed a font in a Word document](/guides/dotnet/conversion/embed-font-in-word-document.md)
- [Convert emails (MSG/EML) to PDF in C#](/guides/dotnet/conversion/email-to-pdf.md)
- [Convert HTML to PDF using C# and .NET](/guides/dotnet/conversion/html-to-pdf.md)
- [Convert HTML to Word in C#](/guides/dotnet/conversion/html-to-word.md)
- [Convert Excel to PDF in C#](/guides/dotnet/conversion/excel-to-pdf.md)
- [Convert images to PDFs in C#](/guides/dotnet/conversion/image-to-pdf.md)
- [Convert files to PDF in C# .NET](/guides/dotnet/conversion.md)
- [Convert JPG to PDF in C#](/guides/dotnet/conversion/jpg-to-pdf.md)
- [Convert PDF to Excel in C#](/guides/dotnet/conversion/pdf-to-excel.md)
- [Merge and combine multiple files into a PDF in C#](/guides/dotnet/conversion/merge-to-pdf.md)
- [Convert MS Office files to PDFs in C#](/guides/dotnet/conversion/office-to-pdf.md)
- [Convert PDF to bitmap (BMP) in C#](/guides/dotnet/conversion/pdf-to-bmp.md)
- [Converting a document from PDF to Markdown format](/guides/dotnet/conversion/pdf-to-markdown.md)
- [Convert images to PDFs in C#](/guides/dotnet/conversion/pdf-to-image.md)
- [Convert PDF to JPG in C#](/guides/dotnet/conversion/pdf-to-jpg.md)
- [Convert PDF to other images in C#](/guides/dotnet/conversion/pdf-to-other-image.md)
- [Convert PDF to PNG in C#](/guides/dotnet/conversion/pdf-to-png.md)
- [Convert PDF to PDF/UA](/guides/dotnet/conversion/pdf-to-pdf-ua.md)
- [Convert PDF to PDF/A](/guides/dotnet/conversion/pdf-to-pdfa.md)
- [Convert PDF to PowerPoint in C#](/guides/dotnet/conversion/pdf-to-powerpoint.md)
- [Converting a document from Markdown to PDF format](/guides/dotnet/conversion/markdown-to-pdf.md)
- [Convert PDF to SVG in C#](/guides/dotnet/conversion/pdf-to-svg.md)
- [Convert PDF to TIFF in C#](/guides/dotnet/conversion/pdf-to-tiff.md)
- [Convert PDF to Word in C#](/guides/dotnet/conversion/pdf-to-word.md)
- [Convert PNG to PDF in C#](/guides/dotnet/conversion/png-to-pdf.md)
- [Convert PowerPoint to PDF in C#](/guides/dotnet/conversion/powerpoint-to-pdf.md)
- [Convert RTF to Word in C#](/guides/dotnet/conversion/rtf-to-docx.md)
- [Convert SVG to PDF in C#](/guides/dotnet/conversion/svg-to-pdf.md)
- [Convert RTF to PDF in C#](/guides/dotnet/conversion/rtf-to-pdf.md)
- [Convert TIFF to PDF in C#](/guides/dotnet/conversion/tiff-to-pdf.md)
- [Convert to Word, Excel, or PowerPoint in C#](/guides/dotnet/conversion/to-office.md)
- [Convert text to PDF in C#](/guides/dotnet/conversion/text-to-pdf.md)
- [Convert Word to PDF in C#](/guides/dotnet/conversion/word-to-pdf.md)

