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

Free Support Forum - aspose.com

Aspose.Words Docx to images?

Aspose.words.
I want to display a preview version of a document to user. This document should have an image some portion of the text. According to requirements, Watermark is not the solution. We want to insert images on every page over the text. Also we want to make sure that the document is presented as images. I know i can convert the document to png but for some reason, only the first page is getting saved in my memory stream. how can i return all images at once? Again, i don’t want to use multiframe tiff. I want to return png images. Please provide help. Please note questions are:
1. Image over text on each page.
2. Docx is converted to multiple pngs in the memory stream and returned.

Thankyou .

Hi

Thanks for your request. You can use code like the following to save each page of the document as an image:

// Open document.

Document doc = new Document(@"Test001\in.docx");

ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png);

options.PageCount = 1;

// Save each page of the document as PNG.

for (int i = 0; i < doc.PageCount; i++)

{

options.PageIndex = i;

doc.Save(string.Format(@"Test001\out_{0}.png", i), options);

}

Hope this helps.

Best regards,