Skip to content

Commit

Permalink
Fixes all examples to require workerSrc to be set.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Nov 6, 2015
1 parent 28d3406 commit 601d29b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
6 changes: 2 additions & 4 deletions examples/components/pageviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ if (!PDFJS.PDFViewer || !PDFJS.getDocument) {
' `node make generic components`');
}

// In cases when the pdf.worker.js is located at the different folder than the
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
// shall be specified.
// The workerSrc property shall be specified.
//
// PDFJS.workerSrc = '../../build/pdf.worker.js';
PDFJS.workerSrc = '../../build/pdf.worker.js';

// Some PDFs need external cmaps.
//
Expand Down
6 changes: 2 additions & 4 deletions examples/components/simpleviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ if (!PDFJS.PDFViewer || !PDFJS.getDocument) {
' `node make generic components`');
}

// In cases when the pdf.worker.js is located at the different folder than the
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
// shall be specified.
// The workerSrc property shall be specified.
//
// PDFJS.workerSrc = '../../build/pdf.worker.js';
PDFJS.workerSrc = '../../build/pdf.worker.js';

// Some PDFs need external cmaps.
//
Expand Down
6 changes: 2 additions & 4 deletions examples/learning/helloworld.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ <h1>'Hello, world!' example</h1>
// PDFJS.disableWorker = true;

//
// In cases when the pdf.worker.js is located at the different folder than the
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
// shall be specified.
// The workerSrc property shall be specified.
//
// PDFJS.workerSrc = '../../build/pdf.worker.js';
PDFJS.workerSrc = '../../build/pdf.worker.js';

//
// Asynchronous download PDF
Expand Down
7 changes: 3 additions & 4 deletions examples/learning/helloworld64.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ <h1>'Hello, world!' example</h1>
//
// PDFJS.disableWorker = true;

// In cases when the pdf.worker.js is located at the different folder than the
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
// shall be specified.
//
// PDFJS.workerSrc = '../../build/pdf.worker.js';
// The workerSrc property shall be specified.
//
PDFJS.workerSrc = '../../build/pdf.worker.js';

// Opening PDF by passing its binary data as a string. It is still preferable
// to use Uint8Array, but string or array-like structure will work too.
Expand Down
2 changes: 2 additions & 0 deletions examples/text-only/pdf2svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var PAGE_NUMBER = 1;
var PAGE_SCALE = 1.5;
var SVG_NS = 'http://www.w3.org/2000/svg';

PDFJS.workerSrc = '../../build/pdf.worker.js';

function buildSVG(viewport, textContent) {
// Building SVG with size of the viewport (for simplicity)
var svg = document.createElementNS(SVG_NS, 'svg:svg');
Expand Down
4 changes: 3 additions & 1 deletion src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ PDFJS.disableWorker = (PDFJS.disableWorker === undefined ?
/**
* Path and filename of the worker file. Required when the worker is enabled in
* development mode. If unspecified in the production build, the worker will be
* loaded based on the location of the pdf.js file.
* loaded based on the location of the pdf.js file. It is recommended that
* the workerSrc is set in a custom application to prevent issues caused by
* third-party frameworks and libraries.
* @var {string}
*/
PDFJS.workerSrc = (PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc);
Expand Down

0 comments on commit 601d29b

Please sign in to comment.