Revert "[api-minor] Allow loading pdf fonts into another document."

This commit is contained in:
Jonas Jenwald 2020-08-01 12:52:39 +02:00 committed by GitHub
parent 173b92a873
commit 05baa4c89f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 158 deletions

View file

@ -65,16 +65,11 @@ class BaseCanvasFactory {
}
class DOMCanvasFactory extends BaseCanvasFactory {
constructor({ ownerDocument = globalThis.document } = {}) {
super();
this._document = ownerDocument;
}
create(width, height) {
if (width <= 0 || height <= 0) {
throw new Error("Invalid canvas size");
}
const canvas = this._document.createElement("canvas");
const canvas = document.createElement("canvas");
const context = canvas.getContext("2d");
canvas.width = width;
canvas.height = height;