Home Forums Chart Support Add Extra Text to the PDF file

Add Extra Text to the PDF file

Viewing 4 posts - 1 through 4 (of 4 total)
  • #39383

    While Dowloading the Graph , how to add some extra text or html code in the PDF with the Graph ???

    #39385

    @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.

    Exporting chart in PDF format using jspdf

    —-
    Manoj Mohan
    Team CanvasJS

    #39388

    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 ??

    #39402

    @ankur,

    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");
    

    —-
    Manoj Mohan
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.