/pdfjs-web-example-javascript

Example project for building a JavaScript PDF viewer with PDF.js. See the blog post for setup and usage.

Primary LanguageJavaScriptMIT LicenseMIT

PDF.js Web Example JavaScript

Getting Started

This repository is an example of how to build a JavaScript PDF viewer with PDF.js. Check out the related blog post.

Serving the Examples

  1. Navigate to the directory you want to display the examples in.
cd pdfjs-display-example
# or
cd pdfjs-viewer-example
  1. Install the serve package:
npm install --global serve
  1. Serve the contents of the current directory:
serve -l 8080 .
  1. Navigate to http://localhost:8080 to view the website.

While running the Viewer example, navigate to http://localhost:8080/web/viewer?file=document.pdf to view the PDF.

Contributing

Please ensure you have signed our CLA so that we can accept your contributions.