Sorry this is kind of long - but here goes:
For example the following xml (also included in the attachment)
<?xml version="1.0" encoding="utf-8"?> <sample> <simpleText>won't wrk <> fsdfsdf !@#$%^&*() </simpleText> <cdatatext> <![CDATA[A bunch of test stuf --- testing many spaces testing line feeds Testing tabs... !@#$%^&*()_+{}[] another line ]]> </cdatatext> </sample>
XML files that are imported via Acrobat - correctly add the line breaks
XML files that are imported via Aspose Form.ImportXML - ignore the the line breaks:
I am attaching 4 files:
the sample XML file
The source: Untitled.PDF
the PDF file as generated by Acrobat and the PDF file as generated by aspose
Console app used to generate the pdf via aspose:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(“untitled1.pdf”, “importedViaAspose.pdf”);<span style="color:green;">//open xml file.</span> System.IO.<span style="color:#2b91af;">FileStream</span> xmlInputStream = <span style="color:blue;">new</span> <span style="color:#2b91af;">FileStream</span>(<span style="color:#a31515;">"sample.xml"</span>, <span style="color:#2b91af;">FileMode</span>.Open); <span style="color:green;">//import data</span> form.ImportXml(xmlInputStream); <span style="color:green;">//close file stream</span> xmlInputStream.Close(); <span style="color:green;">//save updated document</span> form.Save(); } }
}