如何在vue项目中使用lodop打印插件
如何在vue项目中使用lodop打印插件 - 简书
先写了个webdemo
<%--Created by IntelliJ IDEA.User: AdministratorDate: 2018/12/17Time: 13:49To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html><head><title>$Title$</title><%--<script type="text/javascript" src="../res/vankewebstyle/js/jquery-1.9.0.js"></script>--%><script language="javascript" src="lodop/LodopFuncs.js"></script><object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0><embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop.exe"></embed></object><script type="text/javascript">var LODOP; //声明为全局变量function printPreview(){//创建小票打印页CreatePrintPage();//打印预览LODOP.PREVIEW();}function printOrder() {//创建小票打印页CreatePrintPage();//开始打印LODOP.PRINT();};function CreatePrintPage() {var LODOP=getLodop();LODOP.PRINT_INIT("test");LODOP.SET_PRINT_PAGESIZE (1,'209mm','196mm',2);//设置纸张大小LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT","Auto-Width");//设置页面缩放LODOP.ADD_PRINT_HTM(25,25,"100%","100%",document.getElementById("textarea01").value);//设置页面填充内容//LODOP.PRINT();LODOP.PREVIEW();}</script><body><embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="../res/lodop/install_lodop32.exe"></embed><textarea rows="15" cols="80" style="display: none;" id="textarea01">
<h2> 青岛港国际物流有限公司</h2><h3> 代理费用支出审批单 </h3><p> <strong> NO.1544670046087</strong></p><h3> 申请日期:2018-03-14</h3><table border="1" cellspacing="0" style="width:698.8500pt"><tbody><tr><td colspan="2" style="height:24.9500pt; vertical-align:top; width:141.8000pt"><p>付款方式: </p></td><td colspan="5" style="height:24.9500pt; vertical-align:top; width:324.0500pt"><p>支票 [√] 网付 [ ] 现金 [ ] 其他 [ ] </p></td><td colspan="4" style="height:24.9500pt; vertical-align:top; width:233.0000pt"><p>申请人: </p></td></tr><tr><td colspan="2" style="height:25.5500pt; vertical-align:top; width:141.8000pt"><p>收款单位: </p></td><td colspan="5" style="height:25.5500pt; vertical-align:top; width:324.0500pt"><p>青岛尚世通报关公司</p></td><td colspan="4" style="height:25.5500pt; vertical-align:top; width:233.0000pt"><p>申请部门:矿石 </p></td></tr><tr><td colspan="2" style="height:24.9500pt; vertical-align:top; width:141.8000pt"><p>开户行: </p></td><td colspan="5" style="height:24.9500pt; vertical-align:top; width:324.0500pt"><p>青岛银行崇明岛支行 </p></td><td colspan="4" style="height:24.9500pt; vertical-align:top; width:233.0000pt"><p>结算审核: </p></td></tr><tr><td colspan="2" style="height:24.9500pt; vertical-align:top; width:141.8000pt"><p>账号 </p></td><td colspan="5" style="height:24.9500pt; vertical-align:top; width:324.0500pt"><p>6226661584247</p></td><td colspan="4" style="height:24.9500pt; vertical-align:top; width:233.0000pt"><p> </p></td></tr><tr><td style="height:33.4000pt; vertical-align:top; width:84.9500pt"><p>客户名称 </p></td><td style="height:33.4000pt; vertical-align:top; width:56.8500pt"><p>货种 </p></td><td style="height:33.4000pt; vertical-align:top; width:56.8000pt"><p>船名 </p></td><td style="height:33.4000pt; vertical-align:top; width:71.0500pt"><p>航次 </p></td><td style="height:33.4000pt; vertical-align:top; width:78.1000pt"><p>提单号 </p></td><td style="height:33.4000pt; vertical-align:top; width:99.4500pt"><p>箱型\箱量 </p></td><td colspan="2" style="height:33.4000pt; vertical-align:top; width:92.3000pt"><p>费用项目 </p></td><td style="height:33.4000pt; vertical-align:top; width:81.6500pt"><p>付款金额 </p></td><td colspan="2" style="height:33.4000pt; vertical-align:top; width:77.7000pt"><p>备注 </p></td></tr><tr><td style="height:24.9500pt; vertical-align:top; width:84.9500pt"><p> </p></td><td style="height:24.9500pt; vertical-align:top; width:56.8500pt"><p> </p></td><td style="height:24.9500pt; vertical-align:top; width:56.8000pt"><p> </p></td><td style="height:24.9500pt; vertical-align:top; width:71.0500pt"><p> </p></td><td style="height:24.9500pt; vertical-align:top; width:78.1000pt"><p>附明细 </p></td><td style="height:24.9500pt; vertical-align:top; width:99.4500pt"><p> </p></td><td colspan="2" style="height:24.9500pt; vertical-align:top; width:92.3000pt"><p>单证费 </p></td><td style="height:24.9500pt; vertical-align:top; width:81.6500pt"><p>50.00</p></td><td colspan="2" style="height:24.9500pt; vertical-align:top; width:77.7000pt"><p> </p></td></tr><tr><td style="height:12.7500pt; vertical-align:top; width:84.9500pt"><p>合计(¥/$)</p></td><td style="height:12.7500pt; vertical-align:top; width:56.8500pt"><p> </p></td><td style="height:12.7500pt; vertical-align:top; width:56.8000pt"><p> </p></td><td style="height:12.7500pt; vertical-align:top; width:71.0500pt"><p> </p></td><td style="height:12.7500pt; vertical-align:top; width:78.1000pt"><p> </p></td><td colspan="3" style="height:12.7500pt; vertical-align:top; width:191.7500pt"><p> </p></td><td colspan="2" style="height:12.7500pt; vertical-align:top; width:82.5500pt"><p>50.00</p></td><td style="height:12.7500pt; vertical-align:top; width:76.8000pt"><p> </p></td></tr><tr><td colspan="2" style="height:24.9500pt; vertical-align:top; width:141.8000pt"><p>大写 ( 人民币 / 美金 )</p></td><td colspan="9" style="height:24.9500pt; vertical-align:top; width:557.0500pt"><p>伍拾元整</p></td></tr></tbody>
</table><p>总经理: 财务部经理: 部门经理: </p><p> </p><h2> 代理费用支出审批单明细</h2><p> <strong> NO.1544670046087</strong></p><p> </p><table border="1" cellspacing="0" style="width:429.3500pt"><tbody><tr><td style="height:15.4500pt; vertical-align:top; width:45.4500pt"><p>客户名称 </p></td><td style="height:15.4500pt; vertical-align:top; width:42.9000pt"><p>货种 </p></td><td style="height:15.4500pt; vertical-align:top; width:42.9000pt"><p>船名 </p></td><td style="height:15.4500pt; vertical-align:top; width:45.3000pt"><p>航次 </p></td><td style="height:15.4500pt; vertical-align:top; width:74.7000pt"><p>提单号 </p></td><td style="height:15.4500pt; vertical-align:top; width:45.7500pt"><p>箱型/箱量 </p></td><td style="height:15.4500pt; vertical-align:top; width:42.9000pt"><p>费用项目 </p></td><td style="height:15.4500pt; vertical-align:top; width:46.4000pt"><p>付款金额 </p></td><td style="height:15.4500pt; vertical-align:top; width:42.9000pt"><p>备注 </p></td></tr><tr><td style="height:16.2000pt; vertical-align:top; width:45.4500pt"><p>青岛光辉通达物流仓储公司 </p></td><td style="height:16.2000pt; vertical-align:top; width:42.9000pt"><p>锰矿 </p></td><td style="height:16.2000pt; vertical-align:top; width:42.9000pt"><p>asd </p></td><td style="height:16.2000pt; vertical-align:top; width:45.3000pt"><p>123</p></td><td style="height:16.2000pt; vertical-align:top; width:74.7000pt"><p>SHSGSSGS</p></td><td style="height:16.2000pt; vertical-align:top; width:45.7500pt"><p> </p></td><td style="height:16.2000pt; vertical-align:top; width:42.9000pt"><p>报关费 </p></td><td style="height:16.2000pt; vertical-align:top; width:46.4000pt"><p>¥50.0</p></td><td style="height:16.2000pt; vertical-align:top; width:42.9000pt"><p> </p></td></tr><tr><td style="height:15.4500pt; vertical-align:top; width:45.4500pt"><p>合计(¥/$)</p></td><td colspan="7" style="height:15.4500pt; vertical-align:top; width:340.8500pt"><p>¥50.00</p></td><td style="height:15.4500pt; vertical-align:top; width:42.9000pt"><p> </p></td></tr><tr><td colspan="2" style="height:15.4500pt; vertical-align:top; width:88.3500pt"><p>大写(人民币/美金)</p></td><td colspan="7" style="height:15.4500pt; vertical-align:top; width:340.8500pt"><p>伍拾元整</p></td></tr></tbody>
</table><p> 申请人:徐洋洋 </p><p> 申请日期:2018-03-14</p><p> </p></textarea><input type="button" value="打印预览" onclick="printPreview()" /><!-- 控制打印按钮,自动打印可以直接执行printOrder--><input type="button" value="直接打印" onclick="printOrder()" /></body>
</html>
生成的word的html还未进行页面调整,而且还有一些变形,预览效果显示真的很差...就先这样吧。
如何在vue项目中使用lodop打印插件相关推荐
- 详解如何在vue项目中使用lodop打印插件,以及样式打印预览缺失的问题(底部)
C-Lodop是一个免费云服务程序,可接受来自其它平台浏览器的JavaScrip语句实现远程打印. 目前是各家软件公司进行手机或微信远程打印的流行解决方案. 和其它"云打印"概念相 ...
- 如何在vue项目中引入video.js插件
借鉴了不少文章,照着来净报错,恼了自己给自己留一篇绝不报错的! 参考文章:https://www.jianshu.com/p/8b8023c7ed37 一.安装 $ npm install video ...
- 如何在vue项目中修改less变量,多主题项目解决方案
如何在vue项目中修改less变量,多主题项目解决方案 参考文章: (1)如何在vue项目中修改less变量,多主题项目解决方案 (2)https://www.cnblogs.com/niubilit ...
- 如何在vue项目中使用Highmaps(vue+Highmaps)
如何在vue项目中使用Highmaps 功能需求 思路 分析 实现 第一步:引入 第二步:介绍一下这个world是个啥. 第三步:调用 注意点(十分重要) 写在最后 功能需求 近日我接到了这么一个需求 ...
- 如何在vue项目中设置首页
如何在vue项目中设置首页 1.首先创建一个vue为后缀名的文件,最好在新建的文件夹下面创建,如下图所示: 说明:一般我们的主要页面代码都是写在vue 项目中的这个src文件夹下,项目中所会引用到的组 ...
- 如何在vue项目中系统的使用iconfont字体图标
如何在vue项目中系统的使用iconfont字体图标 前言 iconfont的特色 官网注册 在项目中使用的方式 前言 今天聊一下前端iconfont的使用方式,前端的图标经过这些年的发展,变得更系统 ...
- vux 显示 html,如何在vue项目中使用vux
编者:只需6步,教你如何在vue项目中使用vux, 1.在项目里安装vuxnpm install vux --save2.安装vux-loader (这个vux文档中没有明文跟你说要安装的啦) np ...
- Vue项目中如何引入Toast插件
Vue项目中如何引入Toast插件 安装vue2-toast: npm install vue2-toast -S 在main.js中全局导入vue2-toast import 'vue2-toast ...
- 如何在Vue项目中使用vw实现移动端适配(转)
有关于移动端的适配布局一直以来都是众说纷纭,对应的解决方案也是有很多种.在<使用Flexible实现手淘H5页面的终端适配>提出了Flexible的布局方案,随着viewport单位越来越 ...
最新文章
- 独家 | 在机器学习中利用统计插补来处理缺失值(附代码)
- java初学者必看——J2SE小结
- oracle rman恢复表空间,Oracle数据库RMAN恢复之表空间和数据块介质的恢复
- mysql ehcache_MyBatis使用Ehcache作为二级缓存
- 今天,我收到了蚂蚁金服offer
- 2021年是“三蛇闹春,十鼠抢粮,十一牛耕田”,啥意思?
- 『51cto十周年庆典』社区活动大汇总
- Waydev 客户的GitHub 和 GitLab OAuth 令牌被盗,源代码遭访问
- 扫描仪twain驱动是什么_扫描仪无法显示怎么办 扫描仪无法显示解决方法【详解】...
- Mad Libs 游戏
- 算法:两个数之和为目标数Two Sum II - Input array is sorted
- 西南科技大学OJ题 交换二叉树的孩子结点1105
- GIS软件——arcgis10.2制作符号并链接符号库
- 浅析网站被挂马的代码
- @2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017) K:Kayaking Trip(二分+贪心)
- WINVNC源码分析(四)
- RESLAM/ REVO 编译 实时RGBD基于边缘的slam系统
- 逃离x86架构-----CPU体系结构CISC与RISC之争
- (增删查改+排序+文件存储)通讯录实现(附源码)
- 学校小学计算机教室台账,通州区实验小学专用教室使用台账.doc
热门文章
- C语言 字符串数组 的输入 总结
- 蓝牙和WiFi共存智能手机方案对比(AFH 和三线共存技术)
- android 判断手机是否打开了允许模拟位置选项
- python4.0中文下载_pycharm4.0版本下载-pycharm4.0中文版v4.0.7 官方版 - 极光下载站
- HTML高德地图标点
- 身份证五年前被偷曾挂失 今年春节火车票被别人取走
- 任天堂社长访谈之《超级马里奥3D大陆-名制作人大集结》(下)
- sql优化--勿以善小而不为 勿以恶小而为之
- android layout v19,android-复制API 19之前的RelativeLayout.LayoutParam...
- iOS 8输入法角力场,百度弯道超车?