lodop插件如何让页面整体旋转打印输出(顺时针旋转90度再打印)

2024年06月09日 建站教程

功能介绍:利用lodop插件让页面旋转到指定的位置再进行打印!具体代码如下:

function MyPreview() {	
  var LODOP=getLodop();  
  LODOP.PRINT_INIT("");
  var strHTML=document.getElementsByTagName("html")[0].innerHTML;
  LODOP.ADD_PRINT_HTM(0,0,"100%","100%",strHTML);
  LODOP.NewPageA();
  LODOP.ADD_PRINT_HTM(0,0,"100%","100%",strHTML);
  LODOP.SET_PRINT_STYLEA(2,"AngleOfPageInside",-90);
  LODOP.NewPageA();
  LODOP.ADD_PRINT_HTM(0,0,"100%","100%",strHTML);
  LODOP.SET_PRINT_STYLEA(0,"AngleOfPageInside",90);
  LODOP.NewPageA();
  LODOP.ADD_PRINT_HTM(0,0,"100%","100%",strHTML);
  LODOP.SET_PRINT_STYLEA(0,"AngleOfPageInside",180);

  //--右下角加个页号对象:
  LODOP.ADD_PRINT_TEXT(553,593,165,22,"右下脚的页号:第#页/共&页");
  LODOP.SET_PRINT_STYLEA(0,"ItemType",2);
  LODOP.SET_PRINT_STYLEA(0,"Horient",1);
  LODOP.SET_PRINT_STYLEA(0,"Vorient",1);

  LODOP.PREVIEW();
};

本文链接:http://so.lmcjl.com/news/6234/

展开阅读全文
相关内容