Moving interactive examples to jsfiddle.net

This commit is contained in:
Yury Delendik 2017-02-07 13:11:18 -06:00
parent d7cb46dafc
commit fd4428136b
3 changed files with 23 additions and 3 deletions

View File

@ -102,8 +102,7 @@ the `pdfjs-dist` name. For more information and examples please refer to the
You can play with the PDF.js API directly from your browser through the live
demos below:
+ [Hello world](http://mozilla.github.io/pdf.js/examples/learning/helloworld.html)
+ [Simple reader with prev/next page controls](http://mozilla.github.io/pdf.js/examples/learning/prevnext.html)
+ [Interactive examples](http://mozilla.github.io/pdf.js/examples/index.html#interactive-examples)
The repo contains a hello world example that you can run locally:

View File

@ -61,3 +61,25 @@ var viewport = page.getViewport(1);
var scale = desiredWidth / viewport.width;
var scaledViewport = page.getViewport(scale);
```
## Interactive examples
### Hello World with document load error handling
The example demonstrates how promises can be used to handle errors during loading.
It also demonstrates how to wait until page loaded and rendered.
<script async src="//jsfiddle.net/pdfjs/9engc9mw/embed/js,html,result/"></script>
### Hello World using base64 encoded PDF
The PDF.js can accept any decoded base64 data as an array.
<script async src="//jsfiddle.net/pdfjs/cq0asLqz/embed/js,html,result/"></script>
### Previous/Next example
The same canvas cannot be used to perform to draw two pages at the same time --
the example demonstrate how to wait on previous operation to be complete.
<script async src="//jsfiddle.net/pdfjs/wagvs9Lf/embed/js,html,result/"></script>

View File

@ -119,7 +119,6 @@ target.web = function() {
cp(CHROME_BUILD_DIR + '/*.crx', FIREFOX_BUILD_DIR + '/*.rdf',
GH_PAGES_DIR + EXTENSION_SRC_DIR + 'chromium/');
cp('-R', 'test/features', GH_PAGES_DIR);
cp('-R', 'examples/learning', GH_PAGES_DIR + '/examples/');
cp('-R', JSDOC_DIR + '/*', GH_PAGES_DIR + '/api/draft/');
var wintersmith = require('wintersmith');