分页时 Jasper 遗漏了单词

Jasper missing word when page breaks

我在将 jasper 结果导出为 PDF 时遇到了一点问题。 我对我使用的字体(Century Gothic)使用以下配置:

我还配置了 bold/italic/bold 斜体的字体。

无论如何,当我在 jasper 中看到预览时,我的文档得到以下结果:

您可以看到在第一页的末尾出现了 "uw" 这个词。 但是当我导出 PDF 时,我得到以下结果: 其实"uw"这个词在第一页的末尾已经没有了,第二页的开头也没有了,已经消失了

你对这个问题有想法吗?

我在网上查过,这个问题似乎与错误的字体配置有关,但就我而言,我不认为这是问题所在,因为 PDF 字体在视觉上与 Jasper 预览中的字体匹配.

我有点猜测需要查看您的 .jrxml(包含在问题中会很好)但这可能是问题所在。

您的文本字段太小,无法显示您在 pdf 中使用的字体的所有文本,它会被 jasper 导出报告截断

textField

上设置 isStretchWithOverflow="true"

或者做得更大

有关 isStretchWithOverflow 的注释

Stretching elements in height can be managed very well, due to the section split facility: with very few exceptions (ie the column and page footers), report sections can also stretch beyond the initial specified height, and split onto next page (see the spliType attribute in the element).

Text fields with delayed evaluation do not stretch to acquire all the expression’s content. This is because the text element height is calculated when the report section is generated, and even if the engine comes back later with the text content of the text field, the element height will not adapt, because this would ruin the already created layout. When filling report templates horizontally, dynamic text fields inside the detail section do not stretch to their entire text content, because this might cause misalignment on the horizontal axis of subsequent detail sections. The detail band actually behaves the same as the page and column footers, preserving its declared height when horizontal filling is used.

因此,在页脚和列脚中,isStretchWithOverflow="true" 的工作高度与带区一样高。