@@ -977,7 +977,15 @@ const PDFViewerApplication = {
|
||||
|
||||
await Promise.all(promises);
|
||||
},
|
||||
|
||||
decodeUtf8(bytes) {
|
||||
let str = bytes.split('?');
|
||||
let str2 = str[0].split('/');
|
||||
let name = str2[str2.length-1];
|
||||
name = encodeURIComponent(name);
|
||||
str.shift();
|
||||
str2.pop();
|
||||
return str2.join("/")+'/'+name+'?'+str.join("?");
|
||||
},
|
||||
async open(file, args) {
|
||||
if (this.pdfLoadingTask) {
|
||||
await this.close();
|
||||
@@ -992,6 +1000,7 @@ const PDFViewerApplication = {
|
||||
const parameters = Object.create(null);
|
||||
|
||||
if (typeof file === "string") {
|
||||
file = this.decodeUtf8(file);
|
||||
this.setTitleUsingUrl(file, file);
|
||||
parameters.url = file;
|
||||
} else if (file && "byteLength" in file) {
|
||||
|
||||
Reference in New Issue
Block a user