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 編輯過 |
關鍵字查詢
相關文章
正在查詢... |