mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Merge pull request #18247 from timvandermeij/readme
Don't recommend installing `gulp-cli` globally in the README and on the website
This commit is contained in:
commit
7279ce6bad
2 changed files with 8 additions and 14 deletions
20
README.md
20
README.md
|
@ -40,7 +40,7 @@ PDF.js is built into version 19+ of Firefox.
|
||||||
|
|
||||||
+ The official extension for Chrome can be installed from the [Chrome Web Store](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm).
|
+ The official extension for Chrome can be installed from the [Chrome Web Store](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm).
|
||||||
*This extension is maintained by [@Rob--W](https://github.com/Rob--W).*
|
*This extension is maintained by [@Rob--W](https://github.com/Rob--W).*
|
||||||
+ Build Your Own - Get the code as explained below and issue `gulp chromium`. Then open
|
+ Build Your Own - Get the code as explained below and issue `npx gulp chromium`. Then open
|
||||||
Chrome, go to `Tools > Extension` and load the (unpackaged) extension from the
|
Chrome, go to `Tools > Extension` and load the (unpackaged) extension from the
|
||||||
directory `build/chromium`.
|
directory `build/chromium`.
|
||||||
|
|
||||||
|
@ -52,14 +52,8 @@ To get a local copy of the current code, clone it using git:
|
||||||
$ cd pdf.js
|
$ cd pdf.js
|
||||||
|
|
||||||
Next, install Node.js via the [official package](https://nodejs.org) or via
|
Next, install Node.js via the [official package](https://nodejs.org) or via
|
||||||
[nvm](https://github.com/creationix/nvm). You need to install the gulp package
|
[nvm](https://github.com/creationix/nvm). If everything worked out, install
|
||||||
globally (see also [gulp's getting started](https://github.com/gulpjs/gulp/tree/master/docs/getting-started)):
|
all dependencies for PDF.js:
|
||||||
|
|
||||||
$ npm install -g gulp-cli@^2.3.0
|
|
||||||
|
|
||||||
If you prefer to not install `gulp-cli` globally, you have to prefix all the `gulp` commands with `npx` (for example, `npx gulp server` instead of `gulp server`).
|
|
||||||
|
|
||||||
If everything worked out, install all dependencies for PDF.js:
|
|
||||||
|
|
||||||
$ npm install
|
$ npm install
|
||||||
|
|
||||||
|
@ -69,7 +63,7 @@ If everything worked out, install all dependencies for PDF.js:
|
||||||
Finally, you need to start a local web server as some browsers do not allow opening
|
Finally, you need to start a local web server as some browsers do not allow opening
|
||||||
PDF files using a `file://` URL. Run:
|
PDF files using a `file://` URL. Run:
|
||||||
|
|
||||||
$ gulp server
|
$ npx gulp server
|
||||||
|
|
||||||
and then you can open:
|
and then you can open:
|
||||||
|
|
||||||
|
@ -86,11 +80,11 @@ It is also possible to view all test PDF files on the right side by opening:
|
||||||
In order to bundle all `src/` files into two production scripts and build the generic
|
In order to bundle all `src/` files into two production scripts and build the generic
|
||||||
viewer, run:
|
viewer, run:
|
||||||
|
|
||||||
$ gulp generic
|
$ npx gulp generic
|
||||||
|
|
||||||
If you need to support older browsers, run:
|
If you need to support older browsers, run:
|
||||||
|
|
||||||
$ gulp generic-legacy
|
$ npx gulp generic-legacy
|
||||||
|
|
||||||
This will generate `pdf.js` and `pdf.worker.js` in the `build/generic/build/` directory (respectively `build/generic-legacy/build/`).
|
This will generate `pdf.js` and `pdf.worker.js` in the `build/generic/build/` directory (respectively `build/generic-legacy/build/`).
|
||||||
Both scripts are needed but only `pdf.js` needs to be included since `pdf.worker.js` will
|
Both scripts are needed but only `pdf.js` needs to be included since `pdf.worker.js` will
|
||||||
|
@ -116,7 +110,7 @@ You can play with the PDF.js API directly from your browser using the live demos
|
||||||
|
|
||||||
+ [Interactive examples](https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples)
|
+ [Interactive examples](https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples)
|
||||||
|
|
||||||
More examples can be found in the [examples folder](https://github.com/mozilla/pdf.js/tree/master/examples/). Some of them are using the pdfjs-dist package, which can be built and installed in this repo directory via `gulp dist-install` command.
|
More examples can be found in the [examples folder](https://github.com/mozilla/pdf.js/tree/master/examples/). Some of them are using the pdfjs-dist package, which can be built and installed in this repo directory via `npx gulp dist-install` command.
|
||||||
|
|
||||||
For an introduction to the PDF.js code, check out the presentation by our
|
For an introduction to the PDF.js code, check out the presentation by our
|
||||||
contributor Julian Viereck:
|
contributor Julian Viereck:
|
||||||
|
|
|
@ -119,7 +119,7 @@ Note that we only mention the most relevant files and folders.
|
||||||
|
|
||||||
## Trying the Viewer
|
## Trying the Viewer
|
||||||
|
|
||||||
With the prebuilt or source version, open `web/viewer.html` in a browser and the test pdf should load. Note: the worker is not enabled for file:// urls, so use a server. If you're using the source build and have node, you can run `gulp server`.
|
With the prebuilt or source version, open `web/viewer.html` in a browser and the test pdf should load. Note: the worker is not enabled for file:// urls, so use a server. If you're using the source build and have node, you can run `npx gulp server`.
|
||||||
|
|
||||||
## More Information
|
## More Information
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue