Convert Word DOC to JPEG in C#

Often you need to embed the pages of an MS Word DOC/DOCX into your application programmatically. One of the most commonly used methods for such cases is the conversion of DOC/DOCX to image formats. In this article, you will learn how to convert DOC or DOCX files to JPG in C# .NET. Furthermore, we will demonstrate how to control the DOC to JPG conversion using different options.

C# API to Convert DOC/DOCX to JPG

Aspose.Words for .NET is a powerful API that allows you to create MS Word documents from scratch. Moreover, it lets you manipulate the existing Word documents for encryption, conversion, text extraction, etc. We will use this API to convert DOC/DOCX files to JPG. You can download the API’s DLL or install it directly from NuGet.

PM> Install-Package Aspose.Words

Convert DOC to JPG in C#

Aspose.Words for .NET makes it quite easier for you to convert a DOC/DOCX to desired image format. You can set the output image format as PNG, JPEG, BMP, GIF, or TIFF using SaveFormat enum. The following are the steps to convert DOC/DOCX to JPG image in C#.

The following code sample shows how to convert a DOCX to JPG in C#.

C# DOCX to JPG - Customization

You can also control the DOC to JPG conversion using different options. For example, you can set horizontal resolution, vertical resolution, overall resolution, scale, pixel format, brightness, color mode, contrast, and paper color. The following are the steps to customize DOC to JPG conversion in C#.

The following code sample shows how to control C# DOC to JPG conversion using different options.

C# DOC to JPG Converter - Get a Free License

You can get a temporary license in order to use Aspose.Words for .NET without evaluation limitations.

Conclusion

In this article, you have learned how to convert Word DOC/DOCX to JPG images in C#. Moreover, you have seen how to control DOC to JPG conversion using different options. Apart from that, you can explore other features offered by Aspose.Words for .NET using the documentation. Also, you can post your questions on our forum.

See Also