Skip to content

Commit

Permalink
stephanrauh/ngx-extended-pdf-viewer#1719 stop using the window object…
Browse files Browse the repository at this point in the history
… in the worker thread
  • Loading branch information
stephanrauh committed Apr 18, 2023
1 parent 97fe1fa commit 5796c90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/core/default_appearance.js
Expand Up @@ -115,10 +115,7 @@ class FakeUnicodeFont {
this.fontFamily = fontFamily;

const canvas = new OffscreenCanvas(1, 1);
// #1659 modified by ngx-extended-pdf-viewer
const options = window.pdfDefaultOptions.activateWillReadFrequentlyFlag ? { willReadFrequently: true} : undefined;
this.ctxMeasure = canvas.getContext("2d", options);
// #1659 end of modification by ngx-extended-pdf-viewer
this.ctxMeasure = canvas.getContext("2d");

if (!FakeUnicodeFont._fontNameId) {
FakeUnicodeFont._fontNameId = 1;
Expand Down
5 changes: 1 addition & 4 deletions src/core/image.js
Expand Up @@ -392,10 +392,7 @@ class PDFImage {
}

const canvas = new OffscreenCanvas(width, height);
// #1659 modified by ngx-extended-pdf-viewer
const options = window.pdfDefaultOptions.activateWillReadFrequentlyFlag ? { willReadFrequently: true} : undefined;
const ctx = canvas.getContext("2d", options);
// #1659 end of modification by ngx-extended-pdf-viewer
const ctx = canvas.getContext("2d");
const imgData = ctx.createImageData(width, height);
convertBlackAndWhiteToRGBA({
src: imgArray,
Expand Down

0 comments on commit 5796c90

Please sign in to comment.