There are some related questions about this topic in SO but without a solution (the closest one here)
I have a long text as input for a text field in a jasper report, if the page breaks a part of the text is getting truncated if the split text has a bold text. If the split text is just plain, it works fine.
It seems like JasperReports engine can't calculate the max number of characters in a page if the input text has a bold html tag and then it cuts the leftover words at export to PDF. I'm using JasperReports 6.2.0
This is the source code:
<band height="40" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="30" y="10" width="510" height="20" isPrintWhenDetailOverflows="true">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<printWhenExpression><![CDATA[$P{myInputData} != null]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Justified" markup="html">
<font fontName="ArialExtendedJasper"/>
</textElement>
<textFieldExpression><![CDATA[$P{myInputData}]]></textFieldExpression>
</textField>
</band>
EDIT: Added font extension properties
<?xml version="1.0" encoding="UTF-8"?>
<fontFamilies>
<fontFamily name="ArialExtendedJasper">
<normal>fonts/ArialExtendedJasper/arial.ttf</normal>
<bold>fonts/ArialExtendedJasper/arialbd.ttf</bold>
<italic>fonts/ArialExtendedJasper/ariali.ttf</italic>
<boldItalic>fonts/ArialExtendedJasper/arialbi.ttf</boldItalic>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
</exportFonts>
</fontFamily>
</fontFamilies>