Addressing comments by Vivien
This commit is contained in:
parent
3476364886
commit
bc91b98fc8
@ -1,11 +1,14 @@
|
|||||||
## "Hello World" overview
|
## "Hello World" overview
|
||||||
|
|
||||||
This example is a minimalistic application of the pdf.js project. The file `helloworld.pdf` is from the GNUpdf project (see [Introduction to PDF at GNUpdf](http://gnupdf.org/Introduction_to_PDF), and contains a simple and human-readable PDF.
|
This example is a minimalistic application of the pdf.js project. The file
|
||||||
|
`helloworld.pdf` is from the GNUpdf project (see [Introduction to PDF at GNUpdf](http://gnupdf.org/Introduction_to_PDF), and contains a simple and
|
||||||
|
human-readable PDF.
|
||||||
|
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
Point your browser to `index.html`. Voila. Take a peek at `hello.js` to see how to make basic calls to `pdf.js`.
|
Point your browser to `index.html`. Voila. Take a peek at `hello.js` to see
|
||||||
|
how to make basic calls to `pdf.js`.
|
||||||
|
|
||||||
|
|
||||||
## Additional resources
|
## Additional resources
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ajax GET request for binary files
|
// Ajax GET request, for binary files
|
||||||
// (like jQuery's $.get(), but supports the binary type ArrayBuffer)
|
// (like jQuery's $.get(), but supports the binary type ArrayBuffer)
|
||||||
//
|
//
|
||||||
var binaryGet = function(url, callback){
|
var ajaxGet = function(url, callback){
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url);
|
xhr.open('GET', url);
|
||||||
xhr.mozResponseType = xhr.responseType = 'arraybuffer';
|
xhr.mozResponseType = xhr.responseType = 'arraybuffer';
|
||||||
@ -26,7 +26,7 @@ var binaryGet = function(url, callback){
|
|||||||
//
|
//
|
||||||
// This is where the fun happens
|
// This is where the fun happens
|
||||||
//
|
//
|
||||||
binaryGet('helloworld.pdf', function(data){
|
ajaxGet('helloworld.pdf', function(data){
|
||||||
//
|
//
|
||||||
// Instantiate PDFDoc with PDF data
|
// Instantiate PDFDoc with PDF data
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user