Trying to populate a PDF template via ImportXML. Mostly working, but I have a couple fields that are large, and in which the users often copy/paste formatted data from other applications. Tabs and multiple spaces seem to be handled OK in the translation to PDF, but newlines are getting lost. Is this expected behavior? How can I get the import to honor the newlines?
If it helps, here’s my code (C#):
Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form(); MemoryStream ms = new MemoryStream((new System.Net.WebClient()).DownloadData(@“http://localhost/MYPATH/CompReport.pdf”)); pdfForm.BindPdf(ms); MemoryStream msInput = new MemoryStream((new System.Net.WebClient()).DownloadData(@“http://localhost/MYPATH/CompReport.xml”)); pdfForm.ImportXml(msInput); MemoryStream outStream = new MemoryStream(); pdfForm.Save(outStream); return outStream;
Your output is the same as mine. The layout of the PDF is correct, but the content of the Narrative and Modified Narrative fields is not. As you can see in the XML file, there are newlines in the text. As your attachment shows, those newlines are not reflected in the resulting PDF.