Free Support Forum -

Aspose.Pdf for .NET (Table cell formatting)

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

I would like to check with you regarding the formatting differences between Aspose.Word and Aspose.Pdf.

I use Aspose.Word for the report template and then use Aspose.Pdf to convert into pdf file.

However, I find that the formatting of the cells is different in Aspose.Word and Aspose.Pdf.

I centralized everything in the cells in Aspose.Word template; the .doc file also showed the correct formatting;

but the pdf file is not showing the correct formatting.

Can you help?

This one shown by .doc file; table header (Note that the table content also has this problem).

This one shown by .pdf file. The table content also showed the wrong formatting.


Code is straight-forward from aspose samples:-

Document doc = _Execute(mainKey);

if (ReportParams.WordDir != null && ReportParams.WordDir.ToString() != "")

doc.Save(ReportParams.WordDir + mainKey + ".doc", SaveFormat.Doc);

//convert doc to pdf

string xmlFile = ReportParams.XMLDir + mainKey + ".xml";

doc.Save(xmlFile, SaveFormat.AsposePdf);

Aspose.Pdf.Pdf rptPDF = new Aspose.Pdf.Pdf();

//can add xsl if needed for the report

rptPDF.BindXML(xmlFile, null);

rptPDF.Save(ReportParams.PdfDir + mainKey + ".pdf");

Please advise soon.

Thank you,


This message was posted using Email2Forum by codewarior.

Hello Luke,

Thanks for considering Aspose.

Can you please share the resource word document that you're using so that we can test the scenario at our end.

We apologize for your inconvenience.

I am using Word 2003. Attached is the word template doc.

Anyway, I do not use Aspose.pdf anymore.
I am just using Aspose.Word and I convert from doc file directly to pdf file using the .Save and Saveformat.Pdf.
It works this way and the formatting in the word doc stays in the pdf file too.

By the way, I am trying to create a service to convert data from MS SQL thru stored procedure into pdf file/report. The front end application will request report and the end result is one or more pdf files/reports on the fly. The reports may or may not include charts.

Can you advice what is the best Aspose tools/products to use?

The service program will be written in C# using VS 2008 and data from SQL 2008.



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

Thanks for your request. If you would like to fill your .doc template with data from DB and then convert to PDF, you can ease achieve it, using Aspose.Words.

If you have some additional requirements, please describe them here and I will try to help you.

Best regards,