Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

The Syncfusion .NET Word Library (DocIO) offers powerful and comprehensive APIs to convert a Word document into an image programmatically with a few lines of code and without Microsoft Word or interop dependencies. It allows you to convert an entire document into images or a single page of a Word document to provide a document preview, thumbnail, or to print it.

Convert Word documents to images using C#

This sample code shows how to convert an entire document into images using the Syncfusion .NET Word Library with just few lines of code in C#.

  1. using Syncfusion.DocIO;
  2. using Syncfusion.DocIO.DLS;
  3. using Syncfusion.DocIORenderer;
  4. // Open the Word document file stream
  5. using (FileStream docStream = new FileStream("Template.docx", FileMode.Open, FileAccess.Read))
  6. {
  7. //Load an existing Word document
  8. using (WordDocument wordDocument = new WordDocument(docStream, FormatType.Docx))
  9. {
  10. //Create an instance of DocIORenderer
  11. using (DocIORenderer render = new DocIORenderer())
  12. {
  13. //Convert the entire Word document to images.
  14. Stream[] imageStreams = wordDocument.RenderAsImages();
  15. for (int i = 0; i < imageStreams.Length; i++)
  16. {
  17. //Save the image stream as file
  18. using (FileStream fileStreamOutput = File.Create("WordToImage_" + i + ".jpeg"))
  19. {
  20. imageStreams[i].CopyTo(fileStreamOutput);
  21. }
  22. }
  23. }
  24. }
  25. }

Key features of Word-to-image conversion

Specific pages

Convert a specific page in a Word document into an image.

Specific range of pages

Convert a specified range of pages in a Word document into images.

Font substitution

The built-in font substitution event allows users to choose alternate fonts from the device or upload fonts with a few lines of code.

Fallback fonts

Configure fallback fonts for Unicode text. These fallback fonts come into play when the rendering engine encounters Unicode text that lacks a corresponding glyph in the specified fonts.

Word-to-image conversion references

Discover resources from our blog and knowledge base that enhance your efficiency in Word-to-image conversion.

Ways to Convert Word Documents to Images in C#

Blog

3 Easy Ways to Convert Word Documents to Images in C#

Resolving font problems during Word-to-image conversion

Knowledge base

How to resolve font problems during Word-to-image conversion

Syncfusion .NET Word Library Resources

Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.

Frequently Asked Questions

Word file formats such as DOC, DOT, DOCX, DOTX, DOCM, DOTM, Word Processing 2007 XML, and Word 2003 XML Document (*.xml), as well as other formats like HTML, text, and Markdown are supported.

Yes, you can perform Word-to-image conversion in Linux and different cloud platforms like Azure, Amazon Web Services, and Google Cloud Platform using the .NET Word Library.

If required fonts aren’t installed, the Word Library uses alternatives, possibly causing differences in generated images. Refer to the Knowledge base for solutions to resolve this issue.

Yes, you can programmatically open password-protected Word documents and convert them to images using the .NET Word Library.

Yes, you can convert a specific range of pages in a Word document to images.

You can access it through the Syncfusion.DocIORenderer.Net.Core NuGet package. Detailed code samples and tutorial video are available in the documentation.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion® reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Want to create, View, and edit Word documents in C# or VB.NET?

Start a free 30-day evaluation today!
DOWNLOAD FREE TRIAL

No credit card required.

Mobile Free Evaluation Section

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.

Scroll up icon
Chat with us