|
function click() {
var bounds = diagramInstance.getDiagramBounds();
var node = {
id: "text1",
height: 50,
width: 50,
shape: { type: "Text", content: "Header" },
style: { strokeWidth: 0 },
offsetX: bounds.width / 2,
offsetY: 50
};
diagramInstance.add(node);
var node2 = {
id: "text2",
height: 50,
width: 50,
shape: { type: "Text", content: "Footer" },
style: { strokeWidth: 0 },
offsetX: bounds.width / 2,
offsetY: bounds.height - 50
};
diagramInstance.add(node2);
let options = {};
options.margin = { left: 10, right: 10, top: 10, bottom: 10 };
options.fileName = "format";
options.format = "PNG";
diagramInstance.exportDiagram(options);
diagramInstance.remove(diagramInstance.getObject(node.id));
diagramInstance.remove(diagramInstance.getObject(node2.id));
} |
|
function click() {
var bounds = diagramInstance.getDiagramBounds();
diagramInstance.historyManager.canLog = function(entry) {
entry.cancel = true;
return entry;
};
var node = {
id: "text1",
height: 50,
width: 50,
shape: { type: "Text", content: "Header" },
style: { strokeWidth: 0 },
offsetX: bounds.width / 2,
offsetY: 50
};
diagramInstance.add(node);
var node2 = {
id: "text2",
height: 50,
width: 50,
shape: { type: "Text", content: "Footer" },
style: { strokeWidth: 0 },
offsetX: bounds.width / 2,
offsetY: bounds.height - 50
};
diagramInstance.add(node2);
let options = {};
options.margin = { left: 10, right: 10, top: 10, bottom: 10 };
options.fileName = "format";
options.format = "PNG";
diagramInstance.exportDiagram(options);
diagramInstance.remove(diagramInstance.getObject(node.id));
diagramInstance.remove(diagramInstance.getObject(node2.id));
diagramInstance.historyManager.canLog = function(entry) {
entry.cancel = false;
return entry;
};
} |
Hi,
How we can do this in javascript ej2 by using exportModule.export. Does anyone have any example?
Hi Faran,
We created a sample in JavaScript platform to achieve your requirement. Please refer to the below sample for your reference.
Sample