We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm stuck with a weird error... I don't understand, because the addPage() seems to be a well documented method...
Do not compile due to the following error:
Property 'addPage' does not exists on type 'NodeCanvasRenderingContext2D'.
Note that I try to put the addPage() on the canvas object, then the project compile, but at the runtime, I got the following error:
canvas.addPage is not a function
import { createCanvas } from "canvas"; const canvas = createCanvas(200, 200, "pdf"); const ctx = canvas.getContext('2d'); for (let i=0; i<4; i++) { ctx.fillText("test " + i, 5, 40*i); ctx.addPage(); }
The text was updated successfully, but these errors were encountered:
Hrm, I can't reproduce that.
> const {createCanvas} = require("canvas") > const canvas = createCanvas(200, 200, "pdf"); > const ctx = canvas.getContext("2d") > ctx.addPage() > ctx.addPage [Function: addPage]
Since you're using Typescript, note that #1509 corrected an error in the typings: addPage was declared on the canvas instance instead of the context.
addPage
Can you inspect the properties of your ctx instance?
ctx
Sorry, something went wrong.
ok thanks, it's the same problem that the #1509
Just ran into this myself; is there another anticipated release coming any time soon?
No branches or pull requests
Hi, I'm stuck with a weird error...
I don't understand, because the addPage() seems to be a well documented method...
Issue or Feature
Do not compile due to the following error:
Note that I try to put the addPage() on the canvas object, then the project compile, but at the runtime, I got the following error:
Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: