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

Free Support Forum - aspose.com

How to convert word file into a Bitmap array

Hi,


I’m currently evaluating the Aspose .Net APIs for one of my projects.
Therefor I have a question. I’m searching for a possibility to convert a MS Office Document directly to a Bitmap arry in the PNG format.
But I have only found the possibilty to save ist as png. Is there any possibilty to convert and diectly wirte it in an Bitmap without saving it to the harddrive?

Thanks in advance.

Hi Benjamin,


Thanks for your inquiry. You can convert your document to Image streams using Aspose.Words and store them in ArrayList for example. Please see the following code to generate images per each page in your Word document:

Document doc = new Document(MyDir
@“in.doc”);

ArrayList bmps = new ArrayList();

MemoryStream stream;

ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Bmp);

options.PageCount = 1;

// Save each page of the document as Jpeg.

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

{

stream = new MemoryStream();

options.PageIndex = i;

doc.Save(stream, options);

bmps.Add(stream);

}


I hope, this helps.

Best regards,