<template> <div> <el-button @click="printPdf" >打印</el-button> <form> <table bgcolor="#CCFFCC"><tr><td> <font face="黑体" color="#FF0000" size="3"><u> 《表单一》 </u></font></td></tr></table> <table cellspacing="0" bgcolor="#CCFFFF"style="border-collapse:collapse;table-layout:fixed;border:solid 1px black;"><tr> <td><font color="#0000FF">A</font><font color="#0000FF">等</font></td> <td><font color="#0000FF">B</font><font color="#0000FF">等</font></td> <td><font color="#0000FF">C</font><font color="#0000FF">等</font></td></tr> <tr> <td>A<sub>01</sub></td> <td>中-001</td> <td>C1<sup>x</sup></td> </tr> <tr> <td>A<sub>02</sub>Φ</td> <td>日-スの</td> <td><font face='Vernada'>7㎥</font></td> </tr> <tr><td>A<sub>03</sub><nobr>over隐藏后面的:1234567890</nobr> </td><td>韩-안녕</td><td>C3<sup>x</sup> </td></tr> </table> </form> </div> </template> <script> import {getLodop} from '../common/LodopFuncs' export default { name: "demo", data() { return {} }, methods: { // 查询数据 printPdf() { let LODOP = getLodop(); LODOP.PRINT_INIT("订货单"); LODOP.SET_PRINT_STYLE("FontSize", 18); LODOP.SET_PRINT_STYLE("Bold", 1); LODOP.ADD_PRINT_TEXT(50, 231, 260, 39, "打印页面部分内容"); LODOP.ADD_PRINT_HTM(88, 200, 350, 600, document.getElementById("form1").innerHTML); // LODOP.PRINT(); LODOP.PREVIEW(); }, } } </script>
详解如何在vue项目中使用lodop打印插件(2)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/30568397591d5151a743d8723474ab37.html