Dear Community,
I have implemented an Excel-to-Word converter application using Aspose for .Net framework. But the result of the Aspose-generated word document is little bit different from a manual copy&paste, taken from Excel and put into a new Word document: All the width values of the table and also of each column of an Aspose-generated word document are larger than those of a manually created word document (copy&paste).
Now my question is how this behaviour of Aspose can be corrected by a workaround. I guess the different width values are the result of wrong rounded numbers, which come up as the result of the ConverterUtil.PixelToPoint method. Do you have any kind of solution, how I can solve this problem in my application? The result of an Aspose-generated word document should be identical with a manual (copy&paste) created word document.
Thanks for your reply…
Hi,
Thanks for using Aspose products. It seems that your issue is related to Aspose.Word product. Can you confirm please, so that I move this thread to Aspose.Words forum.
Yes, you can move the thread to Aspose.Words forum.
Hi,
Thanks for your posting and using Aspose.
I have moved your thread to Aspose.Words forum.
Aspose.Words team will help you asap.
Hi Michael,
Thanks for your query. Please use the attached ConverterXls2Doc class to import Excel worksheets to Doc format. If you still face problem, please share your Excel file for investigation purposes.
Hello,
Unfortunately, your converter example does not help, because it should be exactly the other way from Excel to Word. In this case, the Aspose-generated tables/columns have larger width values than the original Excel tables/columns. And in addition, if I copy&paste a table area from Excel to Word, the result of the copied table area is smaller in the word document than the Aspose-generated table export.
I hope, my problem is clear…
Hi Michael,
Thanks for sharing the information. Please share your Excel file and output document file for investigation purposes.
Please find both Excel source file and Word output file attached. The Word file contains the Aspose-generated table and a manually created copy&paste result.
Hi Michael,
Thanks for sharing the documents. Please us the latest version of Aspose.Words for .NET and Aspose.Cells for .NET. Please find the output document generated by using the latest version of Aspose.Words for .NET and Aspose.Cells for .NET.
Hello,
Thanks for your reply. Unfortunately, the problem is also existing, when I use the latest version of Aspose. But the attached out.docx file looks like the expected result. So it seems that there must be some wrong implementation in my converter source code.
It could be helpful for me, if you would (maybe partly) provide the source code of the converter class you have used to create the attached out.docx file for comparison purposes at my site.
Thanks for your support!
Hi Michael,
Please find the source code of ConverterXls2Doc class in attachment. I have used this class as follow:
ConverterXls2Doc xls = new ConverterXls2Doc();
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(MyDir + "LargeTable.xlsx");
Document doc = xls.Convert(wb);
doc.Save(MyDir + "out.docx");