Allow loading pdf fonts into another document.

This commit is contained in:
Jonathan Grimes 2020-07-27 17:22:45 +00:00
parent fea40442f7
commit ac723a1760
5 changed files with 166 additions and 19 deletions

View file

@ -521,6 +521,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
this._textContent = textContent;
this._textContentStream = textContentStream;
this._container = container;
this._document = container.ownerDocument;
this._viewport = viewport;
this._textDivs = textDivs || [];
this._textContentItemsStr = textContentItemsStr || [];
@ -625,7 +626,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
let styleCache = Object.create(null);
// The temporary canvas is used to measure text length in the DOM.
const canvas = document.createElement("canvas");
const canvas = this._document.createElement("canvas");
if (
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")