0xh8h
0xh8h

Reputation: 3509

How to get canvas object from kineticjs?

I'm working on an existing project which uses Kinetic.js to generate base64 dataUrl from canvas. (now I can export this dataUrl to png/jpg perfectly)

I also need to export content on canvas to PDF file. I'm using jsPDF for this.

The problem is jsPDF doesn't work properly when the content of canvas is spread on multiple pages.

I found a solution for this here: https://github.com/MrRio/jsPDF/issues/434#issuecomment-249697715

That's why I need to get canvas from kinetic dataURL in order to retrieve canvas.width, canvas.height

Do you have any idea on this? Thank you very much.

Upvotes: 0

Views: 149

Answers (1)

lavrton
lavrton

Reputation: 20373

var nativeCanvas = layer.getCanvas()._canvas;

Upvotes: 1

Related Questions