How to render the Word document contents page by page as image using DocIO?
Essential® DocIO supports to render the Word document contents page by page as images. You can save rendered page as raster (*.png, *.jpeg, *.bmp,*.tiff, *.gif, etc) or vector formats (*.emf, *.wmf, etc). Essential® DocIO internally uses GDI+ functionality for rendering the Word document contents page by page. Hence this feature will be supported only in the .NET platforms which supports GDI+ functionality.
Below code snippets demonstrates how to render the Word document contents page by page as image using Essential® DocIO.
C#:
// Loads the Word Document WordDocument doc = new WordDocument(@"..\..\Template.docx"); // Converts the Word Document into images Image[] image = doc.RenderAsImages(ImageType.Metafile); //Saves the converted images in png file format to the file system for (int imageIndex = 0; imageIndex < image.Length; imageIndex++) { image[imageIndex].Save("WordToImage_"+imageIndex.ToString()+".png", ImageFormat.Png); }
VB:
'Loads the Word Document Dim doc As New WordDocument("..\..\Template.docx") 'Converts the Word Document into images Dim image As Image() = doc.RenderAsImages(ImageType.Metafile) 'Saves the converted images in png file format to the file system For imageIndex As Integer = 0 To images.Length - 1 images(imageIndex).Save("WordToImage_" & imageIndex.ToString() & ".png",ImageFormat.Png) Next
The below sample demonstrates on how to render the Word document contents page by page as images using Essential® DocIO
Conclusion
I hope you enjoyed learning about how to render the Word document contents page by page as image using Essential® DocIO.
You can refer to our WinForms DocIO feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!