Hiprint
  • Hiprint2中文文档
  • Hiprint在线实例
  • Hiprint转PDF
  • 更新日志
  • 模板设计
  • 下载 v2.5.3
  • q群 867788017(满),561844693 vip群 866855396

表格打印

1.传入模板json 设置表格模板


  hiprint.init();
  hiprintTemplate = new hiprint.PrintTemplate({
     template: JSON.parse($('#barcodeJson1').val()),
     settingContainer: '#PrintElementOptionSetting'
  });

2.通过调用函数方式实现设置表格打印模板


                        <!-- 创建打印模板对象-->
    var hiprintTemplate = new hiprint.PrintTemplate();
                        <!-- 模板对象添加打印面板 paperHeader:页眉线 paperFooter:页尾线-->
    var panel2 = hiprintTemplate2.addPrintPanel({ width: 210, height: 297, paperHeader: 45, paperFooter: 780,paperType:'A4' });
                        <!-- 添加表格元素-->
    panel2.addPrintTable({
    options: {
        "left": 16.5,
        "top": 57,
        "height": 38,
        "width": 562.5,
        "textAlign": "center",
        "field": "table",
    "   columns": [[{
            "title": "姓名",
            "field": "name",
            "width": 99.87127733295982,
            "colspan": 1,
            "rowspan": 1
            }, {
            "title": "性别",
            "field": "gender",
            "width": 95.65764630289445,
            "colspan": 1,
            "rowspan": 1
            }, {
            "title": "爱好",
            "field": "like",
            "width": 104.71872050066564,
            "colspan": 1,
            "rowspan": 1
            }, {
            "width": 101.99066954092144,
            "colspan": 1,
            "rowspan": 1
            }, {
            "width": 81.6409089895988,
            "colspan": 1,
            "rowspan": 1
            }, {
            "width": 89.12077733295979,
            "colspan": 1,
            "rowspan": 1
         }]]
         }
    });
   
                        <!-- 打印设计-->
    hiprintTemplate2.design('#hiprint-printTemplate2');


3.传入HTML超文本设置模板


    <!-- 创建打印模板对象-->
    var hiprintTemplate3 = new hiprint.PrintTemplate();
    <!-- 模板对象添加打印面板 paperHeader:页眉线 paperFooter:页尾线-->
    var panel3 = hiprintTemplate3.addPrintPanel({ width: 210, height: 297, paperHeader: 45, paperFooter: 780,paperType:'A4' });
    <!-- 传入超文本-->
    panel3.addPrintTable({ options: { "left": 16.5,"top": 57,"height": 38,"width": 562.5,"textAlign": "center","content": $('#tablehtml').html() } });

姓名 性别 爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
hiprint男喜爱唱歌跳舞,乒乓球,篮球,足球,等各种爱好
表脚