Display a newline character in a PDF generated using FOP

I am creating a PDF using FOP. The source XML contains some textual data containing newlines. But when it is displayed in PDF, all newlines are converted to spaces. I tried replacing all \ n characters with


 

in java code, but that doesn't help either. How can I display newlines in a PDF document? Can you submit your suggestions?

Thanks in advance.

+5
source share
1 answer

oopsie ... figured it out.

linefeed-treatment="preserve"

Must be added to fo: block ... thats all

+10
source

All Articles