1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Fetches pdf data in the worker

This commit is contained in:
Yury Delendik 2012-06-23 14:48:33 -05:00
parent e2b0c76585
commit 00f1d6dbf1
6 changed files with 137 additions and 52 deletions

View file

@ -26,6 +26,10 @@ function getFileName(url) {
return url.substring(url.lastIndexOf('/', end) + 1, end);
}
function expandUrl(url) {
return PDFJS.combineUrl(window.location.href, url);
}
var Cache = function cacheCache(size) {
var data = [];
this.push = function cachePush(view) {
@ -376,7 +380,7 @@ var PDFView = {
if (typeof url === 'string') { // URL
this.url = url;
document.title = decodeURIComponent(getFileName(url)) || url;
parameters.url = url;
parameters.url = expandUrl(url);
} else if (url && 'byteLength' in url) { // ArrayBuffer
parameters.data = url;
}