I believe the problem is that by default XML does NOT respect whitespace!  If 
you wish it to, you need to add the appropriate attribute to the XML grammar (I 
think it's ignoreWhitespace="false").

Leoanrd

-----Original Message-----
From: jyan [mailto:[email protected]] 
Sent: Sunday, December 27, 2009 8:03 PM
To: [email protected]
Subject: [iText-questions] iTextSharp merging XFDF with PDF loses line breaks


I have a code to load up an XFDF that looks like this:

<field name="field4">
<value>asdfsaf
asdfasf
asdfsa

asdfsafdsafsa safd asf sdaf safd sda fas asfs asdf saf asdf asfd a fdas
dfgdsg
sdgsd

gsd
</value>

to a pdf with the following code:
 XfdfReader xfdfReader = new XfdfReader(memoryStream.ToArray());
            AcroFields acroFields = stamper.AcroFields;
            acroFields.SetFields(xfdfReader);
            stamper.FreeTextFlattening = true;
            stamper.FormFlattening = true;
            stamper.Writer.CloseStream = false;

The issue I have is when the resulting PDF is viewed the line breaks are
gone.. so those that type paragraphs that hit return twice for line breaks,
they disappear.. the resulting pdf shows this instead:

asdfsaf
asdfasf
asdfsa
asdfsafdsafsa safd asf sdaf safd sda fas asfs asdf saf asdf asfd a fdas
dfgdsg
sdgsd
gsd

Is there a way to merge the XFDF with the PDF so that the line breaks which
are shown in the XFDF are preserved?
-- 
View this message in context: 
http://old.nabble.com/iTextSharp-merging-XFDF-with-PDF-loses-line-breaks-tp26938712p26938712.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to