Fabric.js: Node-Canvas support

Created on 24 Nov 2017  路  7Comments  路  Source: fabricjs/fabric.js

Hi,
I'm using (have to use) version 2.0.0 rc1
Can you please add node-canvas support again?

All 7 comments

Hi,
node-canvas support is there.
Hasn't be removed.
You do not need anymore to us createCanvasForNode but just use standar code
var canvas = new fabric.StaticCanvas()

What is the problem actually?

If I try it

const fabric = require("fabric").fabric;
const fcanvas = new fabric.StaticCanvas();

const rect = new fabric.Rect({
  left: 50, top: 50, originX: "center", originY: "center", fill: "red", width: 50, "height": 50
});
fcanvas.add(rect);

console.log(fcanvas.createPNGStream());

I get this error
fcanvas.createPNGStream is not a function

ok maybe createPNGStream was a rush deletion. coming back.

trying to release rc2 today with those fixes.

Thank you very much

May not be possible to restore now.
I asked for support to JSDOM.
If you need to access the data as a buffer, can you use the toBlob method or is not possible?

Canvas.lowerCanvasEl.toBlob

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amancqlsys picture amancqlsys  路  5Comments

bevacqua picture bevacqua  路  4Comments

Vivek-KT picture Vivek-KT  路  3Comments

urcoder picture urcoder  路  5Comments

eugene-g13 picture eugene-g13  路  3Comments