Jasper Reports不在pdf文件中加粗文本

时间:2017-06-30 07:45:07

标签: jasper-reports export-to-pdf

使用jasper报告(1.3)和itext库(1.3.1)制作pdf报告。字体定义如下:

<reportFont name="font-normal" isDefault="true" fontName="Code2000" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="CODE2000.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/>

我们明确设置了isBold =“true”,但报告中没有任何内容是粗体。字体CODE2000.TTF可以在粗体样式的MS Word中使用。我们也尝试了没有成功在内部元素上设置isBold =“true”,如:

<textField>
  <reportElement positionType="Float" x="0" y="120" width="694" height="14"/>
  <textElement>
    <font size="9" pdfFontName="CODE2000.ttf" pdfEncoding="Identity-H" isPdfEmbedded="true" isBold="true"/>
  </textElement>
  <textFieldExpression class="java.lang.String">
     "TITLE:"+str($P{title})
  </textFieldExpression>
</textField>

感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

以下解决了这个问题: GetValue() method