Skip to content
This repository has been archived by the owner on Apr 12, 2018. It is now read-only.

Compiled version of pdf.js viewer, modified to run embedded

License

Notifications You must be signed in to change notification settings

Aperta-project/pdf.js-viewer

 
 

Repository files navigation

PDF.js viewer

PDF.js is a Portable Document Format (PDF) library that is built with HTML5.

This is a build version of the PDF.js, including the viewer.

Installation

bower install pdf.js-viewer

Usage

Include viewer.html using SSI or your favorite templating system.

<html>
  <head>
    <title>PDF.js viewer</title>
    <script src="bower_components/pdf.js-viewer/pdf.js"></script>
    <link rel="stylesheet" href="bower_components/pdf.js-viewer/viewer.css">
    
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>

  <body>
    <div class="pdfjs">
      <!--#include virtual="bower_components/pdf.js-viewer/viewer.html" --> 
    </div>

    <script>
      PDFJS.webViewerLoad('some-document.pdf');
    </script>
  </body>
</html>

Upgrading the source

Normally mozilla's PDF js viewer, will only run as standalone. We forked the project and patched it, so you can include it within a page.

To update this version, get the patched pdf.js source code and build the project

git clone https://github.com/legalthings/pdf.js.git
cd pdf.js
npm install
gulp generic
cd ..

And update the files from source and patch them

cd pdf.js-viewer
npm install
./build.sh ../pdf.js/build/generic/

About

Compiled version of pdf.js viewer, modified to run embedded

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 96.7%
  • CSS 2.4%
  • Other 0.9%