html - JasperReports html 导出

标签 html height width jasper-reports render

我在 JasperReports 中开发了一份报告,当导出为 PDF 时它看起来很好,但是当我将相同的报告导出为 HTML 时它看起来更小。有谁知道如何设置参数以使其在 PDF 和 HTML 中正确显示。也可以将 pageWidth 高度等指定为百分比

最佳答案

查看html的源码,可能会发现字体单位是px,而PDF使用的字体单位是pt,所以html的字体比pdf小。所以你可能需要下面的代码来设置html字体单位为pt。

 exporter.setParameter(JRHtmlExporterParameter.SIZE_UNIT, JRHtmlExporterParameter.SIZE_UNIT_POINT);

关于html - JasperReports html 导出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7399741/

相关文章:

listview - Xamarin.Forms ListView 大小适合内容吗?

css - 覆盖并重置 CSS 样式 : auto or none don't work

javascript - 创建一个随着正文溢出而滚动的粘性表头

html - 如何在 Ionic Framework 中更改按钮颜色和文本?

javascript - HTML5 电子邮件输入不验证 Chrome 39 中的 utf-8

ios - 使用 heightForRowAtIndexPath 设置 UITableViewCell 高度 *without*

javascript - jquery - 设置 float div 的动态等高

来自父 div 的可变宽度的 CSS 水平菜单

apache-flex - Flex 4.5 - Spark DropDownList - DropDown 的最小宽度是 anchor 的宽度

html - css 技巧在复制粘贴时禁用文本选择