【发布时间】:2016-03-12 15:20:49
【问题描述】:
我创建了一个 Jasper 报告来显示从 DB 检索到的文本。文本采用 HTML 格式。在 PDF 中显示时,我需要对文本进行样式设置和对齐。这是来自 DB 的示例 HTML 文本
<html>
<p><b>This is Bold text</b></p>
<p> This is a paragraph whith indent</p>
<p>This is a paragra with no indent</p>
<p><center>This text should be centered</center></p>
<p><font size="4">This text should be of font size 4</font></p>
</html>
粗体和段落标签可以正常工作。但是字体不适用于 4 号。有一个中心标签用于必须居中对齐的线条。查看 Jasper 文档中心标签未在支持的标签中列出。 http://jasperreports.sourceforge.net/sample.reference/styledtext/index.html
我尝试使用样式和 rtf 标记进行中心对齐,但没有成功。 有没有其他方法可以实现文本对齐作为文本字段中某些行的中心?
如果我以错误的方式使用字体标签,请告诉我。
【问题讨论】:
标签: html jasper-reports text-alignment