• 安卓在线读取pdf失败


    安卓在线读取pdf不能直接打开,而ios可以;

    是因为安卓的webView不支持导致的,

    解决----引入pdf.js文件

    在iframe

     <div class="outer">
          <iframe
            class="show-box"
            :src="'http://uattest.tppension.cntaiping.com/static/mjcd/static/pdf/web/viewer.html?file='+ url"
            id="myiframe"
            scrolling="no"
            frameborder="0"
            width="100%"
            border="0"
          ></iframe>
        </div>
    

      注意:百度到的src路径前面没有域名,只能在本地调试,放到测试或生产上不行,所以要加域名

     created() {
        // // 显示loding
        // Indicator.open("加载中...");
        this.url=encodeURIComponent(this.pdfLink)
        console.log(this.url);
        setTimeout(() => {
          console.log("组件里面显示pdf链接", this.pdfLink);
        }, 0);
        alert('/static/pdf/web/viewer.html?file='+ url)
      },
      props: ["pdfLink"],
      data() {
        return {
          url:""
        };
      },
    

      

     
    mounted() { const myiframe = document.getElementById("myiframe"); const deviceWidth = document.documentElement.clientWidth; const deviceHeight = document.documentElement.clientHeight; myiframe.style.overflow = "scroll"; // myiframe.style.width = Number(deviceWidth) + "px"; //数字是页面布局宽度差值 myiframe.style.height = Number(deviceHeight) + "px"; //数字是页面布局高度差 },

      

  • 相关阅读:
    多线程(一)--线程的运行
    多线程(二)--锁
    守护线程与用户线程
    SWD接口
    RS485,CAN
    tcp/ip协议
    开关电源与线性稳压电源
    与gps相比,北斗的三频信号有什么优势
    射频识别技术(RFID)
    wifi发射模块芯片各个管脚功能,蓝牙和wifi信号互相干扰,2.4GHZ无线技术
  • 原文地址:https://www.cnblogs.com/linm/p/13821030.html
Copyright © 2020-2023  润新知