Expected behavior: The output Word document should be same as the PDF which in our case “Motion Number” and the next sentence should be in separated line.
@slai2 Unfortunately, I cannot reproduce the problem on my side using the latest 24.1 version of Aspose.Words and the following simple code:
Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.pdf");
The problem might occur because the fonts required for rendering document are not available on the machine where document is converted to PDF. If Aspose.Words cannot find the font used in the document, the font is substituted . This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to lean where Aspose.Words looks for fonts: https://docs.aspose.com/words/net/specifying-truetype-fonts-location/
var pdfDoc = new Document(file.OpenReadStream());
using (MemoryStream ms = new MemoryStream())
{
pdfDoc.Save(ms, SaveFormat.Docx);
return GetFileInfo(file, ms.ToArray(), "docx");
}
@slai2
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-26523
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Also, please note, Aspose.Words is designed to work with MS Word documents. MS Word documents are flow documents and they have structure very similar to Aspose.Words Document Object Model. On the other hand PDF documents are fixed page format documents . While loading PDF document, Aspose.Words converts Fixed Page Document structure into the Flow Document Object Model. Unfortunately, such conversion does not guaranty 100% fidelity.