search

Home  >  Q&A  >  body text

javascript - Can anyone recommend a plugin that can preview PDF in dom elements?

Similar to the effect in the picture, now I use a PDF plug-in called objectPDF.js. After using it, the dom elements behind the PDF preview plug-in are gone.

ringa_leeringa_lee2799 days ago616

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-19 10:11:10

    确定你用对了 PDFObject 了吗?

    1. Create a container to hold your PDF

      <p id="example1"></p>
    2. Tell PDFObject which PDF to embed, and where to embed it

      <script src="/js/pdfobject.js"></script>
      <script>PDFObject.embed("/pdf/sample-3pp.pdf", "#example1");</script>
    3. You can optionally use CSS to specify visual styling, including dimensions, border, margins, etc.

      <style>
        .pdfobject-container { height: 500px;}
        .pdfobject { border: 1px solid #666; }
      </style>

    reply
    0
  • 怪我咯

    怪我咯2017-05-19 10:11:10

    Give me the code structure. This is not a problem that can be seen at a glance

    reply
    0
  • Cancelreply