mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Revert "[api-minor] Allow loading pdf fonts into another document."
This commit is contained in:
parent
173b92a873
commit
05baa4c89f
5 changed files with 19 additions and 158 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue