在使用 FOP 生成的 PDF 中显示换行符

发布于 2024-08-16 19:40:25 字数 194 浏览 3 评论 0原文

我正在使用 FOP 生成 PDF 文档。源 XML 包含一些包含换行符的文本数据。但是当它以 PDF 形式显示时,所有新行都会转换为空格。我尝试用 java 代码中的所有 \n 字符替换,


 

但这也没有帮助。如何在PDF文档中显示新行? 您能提供您的建议吗?

提前致谢。

I'm generating a PDF document using FOP. The source XML contains some text data which contains newlines. But when its being shown in PDF, all new lines are converted into spaces. I tried replacing all \n characters with


 

in the java code but that is not helping too. How can I display the new lines in PDF document?
Can you please provide your suggestions?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酷炫老祖宗 2024-08-23 19:40:25

oopsie...弄清楚了..

linefeed-treatment="preserve"

应该添加到 fo:block...仅此而已

oopsie...figured it out..

linefeed-treatment="preserve"

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文