This topic shows, how to convert Word Document to Images using C++ in a very simple manner. You can convert specific or all pages of a Word document to any of image formats including Tiff, PNG, JPEG and BMP in C++.
Steps to Convert Word Document to Images using C++
- Use Aspose.Words.Cpp NuGet package
- Include reference to Aspose::Words and Saving namespaces
- Create an instance of Document Class to load the source Word file
- Set the SaveFormat to PNG
- Set the Page Ranges for saving as image and set Callback
- Save the Word File to Image in C++ by using Save method
In the following example, we have shown how to add DOCX comments in C++ using few API calls with no dependence on Microsoft Word or Office Interop API.
Code to Convert Word Document to Images using C++
In previous example, we saw How to Convert HTML to PDF using C++. In this topic, we have shown how to export Word Document to images in C++. You have seen, how easy it is to render document to PNG in C++ using few lines of code.