我有一个 jasper 报告模板,页面大小为 A4,现在想在 B5 纸上打印,我能做些什么来使内容不从纸上打印出来。
1
您需要在jasperReport
标记上设置pageWidth="501"
和pageHeight="709"
ISO 216,如您所见,B5 为 176 × 250 毫米
在 jasper 中,报告大小以像素 (DPI 72) 表示
pixels = (mm * dpi) / 25.4; //The DPI in jasper report is 72
计算将给出宽度 499,jasper report 用作默认 501,考虑到格式具有 1,5 mm 的公差,任何一个值都可以。
带有边距 20 的示例
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="testSize" pageWidth="501" pageHeight="709" columnWidth="461" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e1be95c1-b1c3-499e-b902-99cda67676af">
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(50条)