You must be logged in to post your query.
Home › Forums › Chart Support › Add Extra Text to the PDF file
While Dowloading the Graph , how to add some extra text or html code in the PDF with the Graph ???
@ankur,
We don’t have exporting chart in pdf as an inbuilt feature as of now. However with few lines of code, you can export the chart in PDF using jsPDF. Please check out the code-snippet below.
var pdf = new jsPDF(); pdf.addImage(dataURL, 'JPEG', 0, 0); pdf.save("download.pdf");
Also, have a look at this JSFiddle for complete code. You can refer to the jsPDF documentation for more information about the methods available in jsPDF library.
—- Manoj Mohan Team CanvasJS
Yes .. Thanks for the update .. i do download the graph in PDF but my question is .. i need to add some more extra text or image or html tags to the PDF along with Graph … is that possible or not ??
You can use text() method of jsPDF to add extra content after chart as shown in the code snippet below.
var pdf = new jspdf.jsPDF(); pdf.addImage(dataURL, 'JPEG', 0, 0); pdf.text(0, 230, "Simple Column Chart") pdf.save("download.pdf");
You must be logged in to reply to this topic. Login/Register