Hello,
I convert an xml file to a pdf file using aspose.word in a simple way :
License l = new License();
l.SetLicense(“Aspose.Words.NET.lic”);
Document doc = new Document(WMLFile);
doc.Save(PDFFile,Aspose.Words.SaveFormat.Pdf);
In the pdf file, I have underline before some lines (see picture joined). And I wonder why ? Could you help me, please ?
In the zip file, you will find the xml and pdf files.
@DeGamma If open the document in MS Word, you will see the same result. This “underline” is zero text with zero font size. Please see the fragment of your document:
As you can see the first run has zero font size. You can correct this programmatically using Aspose.Words. For example see the following code:
Document doc = new Document(@"C:\Temp\1841.xml");
NodeCollection runs = doc.GetChildNodes(NodeType.Run, true);
foreach (Run r in runs)
{
if (r.Font.Size == 0)
{
// If you need to hide this run
//r.Font.Hidden = true;
// If you need to display it
r.Font.Size = 9;
}
}
doc.Save(@"C:\Temp\out.pdf");