Word to Png

Hello I’m trying to convert a doc file to png file.

But only 1st page is getting converted into png.

what am I missing. I also have a temporary Aspose.Total.lic file.
Thank You.

Hi Purnima,

Thanks for your inquiry. In order to save all pages in Microsoft Word document to separate image files, please use the following code snippet. The ImageSaveOptions class allows to specify additional options when rendering document pages or shapes to images. Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");
ImageSaveOptions imgOptions = new ImageSaveOptions(SaveFormat.Png);
imgOptions.Resolution = 300;
doc.UpdatePageLayout();
for (int iPage = 0; iPage < doc.PageCount; iPage++)
{
    imgOptions.PageCount = 1;
    imgOptions.PageIndex = iPage;
    doc.Save(MyDir + "out" + iPage + ".png", imgOptions);
}