Search code examples
fontsjasper-reportsexport-to-pdf

Jasper missing word when page breaks


I have a little problem when I export the jasper result in PDF. I use the following configuration for the font i use (Century Gothic): enter image description here

I also configured the font for bold/italic/bold italic.

Anyway when I see the preview in jasper i have the following result for my document: enter image description here

You can see that at the end of the first page there is the word "uw" present. But when i export the PDF, i have the following result: enter image description here Actually, the word "uw" is no more at the end of the first page, neither at the beginning of the second page, it has disappeared.

Have you an idea about the problem?

I have checked on the web, this problem seems to be related to a bad font configuration, but in my case i don't think this is the problem, since the PDF font match visually with the font in Jasper preview.


Solution

  • I'm a little bit guessing need to see your .jrxml (it would be good to included in question) but this could be the problem.

    Your textfield is to small to show all text with the font you are using in pdf, its getting truncated away by jasper report on export

    Set isStretchWithOverflow="true" on the textField

    or do it larger

    NOTES ON 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.

    So in page and column footers the isStretchWithOverflow="true" will only work as high as the band height.