Table headers are not wrapped properly

Hi,

I have attached TestRpt wordml file.
I am converting this wordml file to pdf using Aspose.Words.
objDoc.SaveToPdf(0, objDoc.PageCount, strReportFile, null);

Tables in this wordml file are configured to autofit to contents, so you see better table layout in wordml file.
But this file is converted to pdf, table headers are all distorted.
All headers are wrapped on second line which is not expected.
Also find attached pdf generated.

Thanks in advance.

Hi,

I have attached TestRpt wordml file.
I am converting this wordml file to pdf using Aspose.Words.
objDoc.SaveToPdf(0, objDoc.PageCount, strReportFile, null);

Tables in this wordml file are configured to autofit to contents, so you see better table layout in wordml file.
But this file is converted to pdf, table headers are all distorted.
All headers are wrapped on second line which is not expected.
Also find attached pdf generated.
Tell me how do I get the table layout properly.

Thanks in advance.

Hi

Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved. Regarding the problem, if you open/save your document using MS Word and then convert to PDF the problem disappears.

Best regards,

I cannot open the document in word.
The pdf conversion is automated in an application which takes this wordml file as input.
And wordml file is also output of another application which is not directly supplied for pdf generation.

Hi

Thank you for additional information. I can suggest you temporary workaround of this issue for now:

Please try using the following code:

// Open Document
Document doc = new Document("TestRpt.xml");
NodeCollection nodes = doc.GetChildNodes(NodeType.Cell, true);
foreach (Cell cell in nodes)
{
    cell.CellFormat.Width = cell.CellFormat.Width + 10;
}
// Save output document
doc.Save("out.pdf");

Best regards,

Thanks Andrew.
This solution works only if column headers are small.
That is not the case always.
So please provide another solution for the same problem.

Another problem which you would see in the attachments is that;
there is extra dot(.) appearing in the pdf document which is not present in wordml document.
Let me know why PDF cnversion should introduce that character?
Position of the dot is varying in different wordml files.

Thanks.

Hello

Thank you for additional information. As I can see you use some old version of Aspose.Words. Please try using the latest version of Aspose.Words (9.3.0). You can download this version from here:

https://downloads.aspose.com/words/net

In case of using the latest version I cannot see any dot inside the output PDF.

Regarding the first problem, I cannot suggest you any other way to work this problem around. You should just wait for the fix of the original issue.

As you can see the problem disappears after open/save the document using MS Word. So it means that there is something wrong with your document, and upon saving MS Word fixes this. Maybe, if you have an ability to control the generating document process, you will be able to fix this problem before conversing to PDF.

Best regards,

The issues you have found earlier (filed as WORDSNET-3822) have been fixed in this Aspose.Words for .NET 22.5 update also available on NuGet.