方法一、修改 viewer.js 中 renderPage方法的PRINT_RESOLUTION属性,将150改成900即可。
image.png

方法二、调用谷歌原始浏览器(但可能会出现兼容性等其他问题)
写法1:

      let pdfResult = base64;// pdf:base64格式;
      let pdfWindow = window.open("")
      pdfWindow.document.write("<iframe id='printIframe' width='100%' height='100%' src='data:application/pdf;base64, " + encodeURI(pdfResult) + "'></iframe>")

写法2:
<iframe style="display:none" id="printIframe" :src="pdfResult"></iframe>

  this.pdfResult = 'data:application/pdf;base64, '+ encodeURI(base64);
  $("#printIframe")[0].contentWindow.print();

写法3:

      let pdf = base64// pdf:base64格式;       
      let doc = document.createElement('a');
      doc.href ='data:application/octet-stream;base64,'+ pdf;
      doc.target ="空白";
      doc.click();
      window.open('data:application/pdf;base64,'+ pdf);

玲珑骰子安红豆
74 声望5 粉丝