Get started with node-i2d to create rich visualisations on node platform.
Integrate source code as specified on the installation page.
Import node-i2djs module
let { canvasPdfLayer } = require("node-i2djs");
Layer Creation:
Node-I2Djs offers an API for generating multi-page PDF documents. The following line of code creates a PDF instance using the canvasPdfLayer function, passing in the canvas context, as well as height and width as arguments.
let PDFInstance = canvasPdfLayer({context config}, height, width);
canvasPdfLayer returns exclusive API to support creation of single or Multi page PDF creations.
Page creation
Invoking addPage method via PDFInstance returns pageInstance.
let pageInstance = PDFInstance.addPage();
Element Creation:
pageInstance provides createEl api to create graphical elements. In the below example we are creating Circle element with attributes and styleproperties as specified below.