JRTextExporterParameter.PROPERTY_CHARACTER_WIDTH,
0
);
if (charWidth < 0)
{
throw new JRException("Character width in pixels must be greater than zero.");
}
else if (charWidth == 0)
{
pageWidthInChars =
getIntegerParameter(
JRTextExporterParameter.PAGE_WIDTH,
JRTextExporterParameter.PROPERTY_PAGE_WIDTH,
0
);
if (pageWidthInChars <= 0)
{
throw new JRException("Character width in pixels or page width in characters must be specified and must be greater than zero.");
}
charWidth = jasperPrint.getPageWidth() / (float)pageWidthInChars;
}
else
{
pageWidthInChars = (int)(jasperPrint.getPageWidth() / charWidth);
}
charHeight =
getFloatParameter(
JRTextExporterParameter.CHARACTER_HEIGHT,
JRTextExporterParameter.PROPERTY_CHARACTER_HEIGHT,
0
);
if (charHeight < 0)
{
throw new JRException("Character height in pixels must be greater than zero.");
}
else if (charHeight == 0)
{
pageHeightInChars =
getIntegerParameter(
JRTextExporterParameter.PAGE_HEIGHT,
JRTextExporterParameter.PROPERTY_PAGE_HEIGHT,
0
);
if (pageHeightInChars <= 0)
{
throw new JRException("Character height in pixels or page height in characters must be specified and must be greater than zero.");
}
charHeight = jasperPrint.getPageHeight() / (float)pageHeightInChars;
}
else