Skip to content

Commit

Permalink
Fix: PDF.js does not load files that have a hash (#) in the name 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm committed Mar 24, 2024
1 parent 5691073 commit 4fda215
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/file-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ var fileCompressed = function(path, _realPath = false, forceType = false, prefix
if(unpdf === false) await loadPdfjs();

this.macosStartAccessingSecurityScopedResource(this.realPath);
this.pdf = await unpdf.getDocument({url: encodeURIComponent(this.realPath).replace(/\%2F/g,'/')/*, nativeImageDecoderSupport: 'none', disableFontFace: true*/}).promise;
this.pdf = await unpdf.getDocument({url: encodeURIComponent(this.realPath).replace(/\%2F/g,'/').replace(/\%5C/g,'\\').replace(/\%3A/g, ':')/*, nativeImageDecoderSupport: 'none', disableFontFace: true*/}).promise;

return this.pdf;

Expand Down Expand Up @@ -2955,4 +2955,4 @@ module.exports = {
macosSecurityScopedBookmarks: macosSecurityScopedBookmarks,
dirSize: dirSize,
dirSizeSync: dirSizeSync,
}
}

0 comments on commit 4fda215

Please sign in to comment.