函数方式 用户调用 添加元素函数生成打印模板
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| 
                                    var hiprintTemplate = new hiprint.PrintTemplate(); var panel=hiprintTemplate.addPrintPanel();//默认添加A4大小的面板 var panel=hiprintTemplate.addPrintPanel({width:30,height:50 });//参数请参考下方列表  | 
                            |||
| width | number | 宽度(毫米) | A4宽 | 
| height | number | 高度(毫米) | A4高 | 
| paperType | string | A3,A4等 自定义则为空 | A4 | 
| paperHeader | number | 
                                    页眉线top值(单位pt),默认0,可空
                                 | 
                                0 | 
| paperFooter | number | 
                                    页尾线top值(单位pt),默认等于纸张高度对应的pt值,可空
                                 | 
                                纸张高pt | 
| paperNumberLeft | number | 
                                    页码left(pt) 默认纸张宽pt-20 可空
                                 | 
                                张宽pt-20 | 
| paperNumberTop | number | 
                                    页码top(pt) 默认纸张高pt-20 可空
                                 | 
                                高pt-20 | 
| paperNumberDisabled | boolean | 
                                    禁用页码。默认false 可空
                                 | 
                                false | 
| rotate | boolean | 
                                    旋转 比如A4纸旋转 上面宽和高需要对换 默认false可空
                                 | 
                                false | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintText({ options:{ width:10,height:10,top:10,left:0,title:'嗨牛牛牛' } }); | |||
options必填 | 
                                object | 文本属性 | null | 
| printElementType | object | 打印对象类型,参数详情参考文本栏目可空 | 
                                null | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
width必填 | 
                                number | 宽度(pt) | |
height必填 | 
                                number | 高度(pt) | |
left必填 | 
                                number | 定位left(pt) | |
top必填 | 
                                number | 定位top(pt) | |
| title | string | 文本内容或标题 | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintLongText({ options:{ width:10,height:10,top:10,left:0,title:'嗨牛牛牛' } }); | |||
options必填 | 
                                object | 文本属性 | null | 
| printElementType | object | 打印对象类型,参数详情参考文本栏目可空 | 
                                null | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
width,height,left,top必填 | 
                                number | 单位(pt) | |
| title | string | 文本内容或标题 | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintTable({ options:{ width:10,height:10,top:10,left:0,content:''||$('') } }); | |||
options必填 | 
                                object | 表格属性 | null | 
| printElementType | object | 打印对象类型,参数详情参考表格栏目可空 | 
                                null | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
width,height,left,top必填 | 
                            |||
| content | string | 表格html string | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintHtml({ options:{ width:10,height:10,top:10,left:0,content:''||$('') } }); | |||
options必填 | 
                                object | html属性 | null | 
| printElementType | object | 打印对象类型,参数详情参考html栏目可空 | 
                                null | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
width,height,left,top必填 | 
                            |||
| content | string||$('') | html string或$(target) | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintImage({ options:{ width:10,height:10,top:10,left:0,src:'' } }); | |||
options必填 | 
                                object | 图片属性 | null | 
| printElementType | object | 打印对象类型,参数详情参考图片栏目可空 | 
                                null | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
width,height,left,top必填 | 
                            |||
| src | string | 图片地址 | 
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintVline({ options:{ width:10,height:10,top:10,left:0 } }); | |||
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintHline({ options:{ width:10,height:10,top:10,left:0 } }); | |||
| 名称 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| panel.addPrintRect({ options:{ width:10,height:10,top:10,left:0 } }); | |||