diff --git a/examples/node/domstubs.js b/examples/node/domstubs.js index b0e422b8a..7149f005d 100644 --- a/examples/node/domstubs.js +++ b/examples/node/domstubs.js @@ -16,6 +16,7 @@ var style = { function xmlEncode(s){ var i = 0, ch; + s = String(s); while (i < s.length && (ch = s[i]) !== '&' && ch !== '<' && ch !== '\"' && ch !== '\n' && ch !== '\r' && ch !== '\t') { i++; diff --git a/examples/node/pdf2svg.js b/examples/node/pdf2svg.js index f5979cacc..1967ee1ff 100644 --- a/examples/node/pdf2svg.js +++ b/examples/node/pdf2svg.js @@ -14,9 +14,10 @@ global.window = global; global.navigator = { userAgent: 'node' }; global.PDFJS = {}; +require('./domstubs.js'); + PDFJS.workerSrc = true; require('../../build/singlefile/build/pdf.combined.js'); -require('./domstubs.js'); // Loading file from file system into typed array var pdfPath = process.argv[2] || '../../web/compressed.tracemonkey-pldi-09.pdf';