Convert Save Word 2007 XML Document (WordML or WML) to Thumbnail Image using C# .NET

We’ve got the new release 6.4 of Aspose.Words.dll and are using the SaveToImage functin to save a copy of image file for thumbnail view. It’s only with some template file that when this was called, each character in the template file will be saved as in a separate line. The code we used was like this:

Document doc = new Document(fileName);
doc.SaveToImage(0, 1, thumbnailPath, null);

I’ve attached a copy of the template and the generated gif file. The template file was created in Word 2003. Interesting thing is if you just type a space in the template file and save again, the problem would have gone. This is on a separate machine with Word 2007. If you only open the file and re-save it with out change, the problem will still be there.

Could you have a look at the template and see what’s special with it and why it’s breaking the SaveToImage function?

Hi

Thanks for your request. I managed to reproduce the problem on my side and created new issue #9150 in our defect database. I will notify you as soon as it is resolved.
The problem occur because width of column is not specified in the source document (WML)

<w:sectPr wsp:rsidR="00D058A2" wsp:rsidSect="00A54C4D">
	<w:pgSz w:w="12240" w:h="15840" />
	<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0" />
	<w:cols w:space="708" w:equalWidth="off">
		<w:col />
	</w:cols>
	<w:docGrid w:line-pitch="360" />
</w:sectPr>

It seems in this case Aspose.Words sets width of column = 0 and that is why problem occurs. This should look like the following:

<w:sectPr wsp:rsidR="00D058A2" wsp:rsidSect="00A54C4D">
	<w:pgSz w:w="12240" w:h="15840" />
	<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0" />
	<w:cols w:space="708" w:equalWidth="off">
		<w:col w:w="9689" />
	</w:cols>
	<w:docGrid w:line-pitch="360" />
</w:sectPr>

Best regards.

The issues you have found earlier (filed as WORDSNET-2424) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.