diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index 8ec158ff888fe..454ceb5f0fca2 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -102,7 +102,7 @@ import { getStringOption, HTMLResult, } from "./utils.js"; -import { stringToBytes, Util, warn } from "../../shared/util.js"; +import { Util, warn } from "../../shared/util.js"; import { getMetrics } from "./fonts.js"; import { recoverJsURL } from "../core_utils.js"; import { searchNode } from "./som.js"; @@ -3427,7 +3427,7 @@ class Image extends StringObject { } if (!buffer && this.transferEncoding === "base64") { - buffer = stringToBytes(atob(this[$content])); + buffer = Uint8Array.fromBase64(this[$content]); } if (!buffer) { diff --git a/src/display/font_loader.js b/src/display/font_loader.js index 1014c536b67e0..4115a71eb5d79 100644 --- a/src/display/font_loader.js +++ b/src/display/font_loader.js @@ -15,7 +15,6 @@ import { assert, - bytesToString, FontRenderOps, isNodeJS, shadow, @@ -399,9 +398,8 @@ class FontFaceObject { if (!this.data || this.disableFontFace) { return null; } - const data = bytesToString(this.data); // Add the @font-face rule to the document. - const url = `url(data:${this.mimetype};base64,${btoa(data)});`; + const url = `url(data:${this.mimetype};base64,${this.data.toBase64()});`; let rule; if (!this.cssFontInfo) { rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`;