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

Free Support Forum - aspose.com

Not all Word documents are producing images

I'm creating thumbnails for a variety of Office documents but not all of them are converting. The documents are a mix of Word, Excel and Powerpoint files. In most cases the error occurs when I call the respective thumbnail creation method. I have about 80 failures out of a total of 4500 documents.

Are there content restrictions for each file type, and if so what are they?

I've attached an example of both a Word document and Excel spreadsheet that fail to convert.

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. There are no any content restrictions. Also I cannot reproduce the problem with broken2.doc on my side. I use the latest version of Aspose.Words 9.1.0 for testing.

Regarding the problem with XLS file, please write to the appropriate forum:

http://www.aspose.com/community/forums/aspose.cells-product-family/19/showforum.aspx

My colleagues from Aspose.Cells team will answer you shortly.

Best regards,

Could there be something wrong with my approach then?

Here's my code:

public byte[] CreateThumbnail(byte[] file, int resolution, int startPage, int numberOfPages)

{

Document doc = new Document(new MemoryStream(file));

ImageOptions options = new ImageOptions();

options.Resolution = resolution;

using (MemoryStream ms = new MemoryStream())

{

doc.SaveToImage(startPage, numberOfPages, ms, ImageFormat.Png, options);

return ms.GetBuffer();

}

}

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Your code looks and works fine on my side.

Best regards,