Open vvasil3v opened 6 years ago
Hello,
Thank you for your suggestions. Here are some answer:
multipleLinksOnInput
?Thank you,
thank you for the reply.
Ok, for the last item it is not a feature yet. Sorry!
ok :)
hello, i have tested with html2pdf - it is exporting empty diagram without anything inside
tried var element = document.getElementById('chart_container'); var element = document.getElementById('flowchrt'); var element = document.getElementsByClassName('flowchart-links-layer');
did you tried or developed something else
thanks
it exporting as PDF, but the path position is changed.
Did you ever get html2pdf working ? I can get it to show the operators but not the links.. they appear all over the place and massive compared to everything else.
I am trying this (I am using Vue with jquery-flowchart) Step 1 Reset the chart
resetZoomToScaleOne: function (e) {
let current = this.currentZoom.scale
let change = Math.abs(1 - current);
this.flowchart.flowchart("setPositionRatio", 1);
var options = {
animate: true,
linearZoom: true,
increment: current < 1 ? change : -change,
maxScale: this.possibleZooms[this.possibleZooms.length - 1],
minScale: this.possibleZooms[0]
};
if (e) {
options.focal = e;
}
this.flowchart.panzoom("zoom", options);
this.currentZoom.scale = 1
},
Step 2 this.focusOperator(startOperator.operatorId,100,500)
Focus the lefthand operator
focusOperator(operatorId,leftMarginOfFocusPoint,topMarginOfFocusPrompt) {
var destOperatorData = this.flowchart.flowchart(
"getOperatorData",
operatorId
);
let left = destOperatorData.left;
let top = destOperatorData.top;
this.flowchart.panzoom("setMatrix", [1, 0, 0, 1, -left + leftMarginOfFocusPoint, -top + topMarginOfFocusPrompt])
},
Step 3 Generate pdf using html2canvas
setTimeout(
function () {
html2canvas(document.querySelector('.chart'), {
scale: 1,
onclone: function (document) {
var svgElements = document.body.querySelectorAll('svg');
svgElements.forEach(function (item) {
item.setAttribute("width", item.getBoundingClientRect().width);
item.setAttribute("height", item.getBoundingClientRect().height);
item.style.width = null;
item.style.height = null;
});
}
})
.then((canvas) => {
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF('p', 'pt', 'a4', true);
const imgProps = pdf.getImageProperties(imgData);
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
pdf.addImage(imgData, 'PNG', 10, 10, pdfWidth, pdfHeight, '', 'FAST');
pdf.save(that.name);
});
}, 1000)
Hope it helps
Hello, This is more as an enhancement questions.
Is it possible to :
thank you.