var options = {};
options.mode = 'Data';
options.margin = {left: 10, right: 10, top: 10, bottom: 10};
options.fileName = 'region';
options.format = 'PNG';
options.region = 'PageSettings';
options.stretch = 'Stretch';
this.diagramObj.exportDiagram(options);
function onselect(args) {
var exportOptions = {};
exportOptions.format = args.item.text;
//set mode as data
exportOptions.mode = 'Data';
exportOptions.region = 'PageSettings';
exportOptions.fileName = 'Export';
exportOptions.margin = { left: 0, top: 0, bottom: 0, right: 0 };
//get the base64 data
var data = diagram.exportDiagram(exportOptions);
console.log(data);
} |
initExportButton(){
// @see https://www.syncfusion.com/forums/152236/how-to-export-a-diagram-to-image-data-not-download
var button = '';
$('#Diagram').before(button);
$('.export-diagram').on('click', function(){
console.log('Exporting diagram');
let exportOptions : IExportOptions = {};
exportOptions.mode = 'Download';
exportOptions.format = 'PNG';
exportOptions.region = 'PageSettings';
exportOptions.fileName = 'Export';
NVCompanyOrgChart.diagram.exportDiagram(exportOptions);
});
}
I thinkt this limitation should be removed since IE is dead (at least not supported anymore)
Edge uses Chromium ;)
Is there any chance to allow rendering svg, html in the near future?
This is a requirement for us.
Edit:
Created a Feature request for it
Hi Hans,
We have an getDiagramContent method which is used to get the diagram DOM element as a string along with all dependent stylesheets. We should pass this HTML in the server side and convert it to image using QTbinaries. Please refer to the below KB for more details. Also, please let us know if you face any problems in converting HTML to Pdf. Also, please let us know if you need a sample for it.
Regards,
Shyam G