相关疑难解决方法(0)

pdf.js与本地pdf文件

我正在尝试pdf.js库,只想在我的服务器上显示本地pdf文件,而不是示例提供的pdf文件.

<html>
<body>
  <canvas id="the-canvas" style="border:1px solid black"></canvas>

  <!-- Use latest PDF.js build from Github -->
  <script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>

  <script type="text/javascript">
    //
    // NOTE:
    // Modifying the URL below to another server will likely *NOT* work. Because of browser
    // security restrictions, we have to use a file server with special headers
    // (CORS) - most servers don't support cross-origin browser requests.
    //
    var url = '/test.pdf';

    //
    // Disable workers to avoid yet another cross-origin issue (workers need the …
Run Code Online (Sandbox Code Playgroud)

html pdf pdf.js

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

html ×1

pdf ×1

pdf.js ×1