We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Converting multiple word doc/pdf pages to images

I am using the trial version of Aspose.Words and Aspose.Pdf to see if they fit our team’s requirements. We need to be able to convert multiple word document and pdf pages to images.I tried converting a word document with multiple pages to image(png format) and I can see only the first page being converted to image. Is there a way to convert all of the pages to images?

@p.ghimire

Thanks for your inquiry. Please check following sample code snippet to convert multiple page DOCX to PNG. Hopefully it will help you to accomplish the task.

Document doc = new Document("Input.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png);
options.PageCount = 1;
           
for (int i = 0; i < doc.PageCount; i++)
{
    options.PageIndex = i;
    doc.Save("AW_pageno_"+i+".png", options);
}

That worked! Thank you, Tilal.