LDOOP在WEB页面打印时设置关联后内容超出新起一页LinkNewPage指令
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
关联打印的时候,top,left关联位置是相对于被关联打印项的偏移值,具体可查看本博客相关介绍博文:LODOP打印控件关联输出各内容 正常情况下,超文本超过打印项高度,或纸张高度会自动分页,如果超文本纸张放不下,会自动分页到第二页,而且是原位置输出。 测试代码: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>WEB打印控件LODOP</title> <script language="javascript" src="LodopFuncs.js"></script> </head> <body> <a href="javascript:prn1_preview()">打印</a><br> <a href="javascript:prn2_preview()">打印加了LinkNewPage的</a> <script language="javascript" type="text/javascript"> var LODOP; //声明为全局变量 function prn1_preview() { LODOP=getLodop(); LODOP.PRINT_INIT("");//初始化 LODOP.SET_PRINT_PAGESIZE(1,1385,400,""); LODOP.ADD_PRINT_TEXT(0,0,100,"100%","文本"); LODOP.ADD_PRINT_HTM(36,9,300,100,"<body>\r HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...</font>\r</body>"); LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1); LODOP.PRINT_DESIGN(); //LODOP.PREVIEW(); }; function prn2_preview() { LODOP=getLodop(); LODOP.PRINT_INIT("");//初始化 LODOP.SET_PRINT_PAGESIZE(1,1385,400,""); LODOP.ADD_PRINT_TEXT(0,0,100,"100%","文本"); LODOP.ADD_PRINT_HTM(36,9,300,100,"<body>\r HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...HTML Demo content\r <br><font color=\"#FF0000\">Double click me and modify...</font>\r</body>"); LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1); LODOP.SET_PRINT_STYLEA(0,"LinkNewPage",true); LODOP.PRINT_DESIGN(); //LODOP.PREVIEW(); }; </script> </body> 图示:
不关联,不关联后放不下自动换页;关联,关联后不设置自动换页;关联 ,关联后设置自动换页。对比图片中的效果,可以看出效果和作用。 该文章在 2023/9/27 0:15:04 编辑过 |
关键字查询
相关文章
正在查询... |