Skip to content

JSPDF addHTML svg image not working . #2625

@iogrey

Description

@iogrey

I have an HTML page which includes SVG chart.
After converting it to PDF all other data shows except SVG.

<body id="pdf">
    <!-- header section -->
     <div class="section-header" id="main_d">
         <h1>
            data
        </h1>
        <svg id="test1"></svg>
     </div>
</body>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js" integrity="sha384-NaWTHo/8YCBYJ59830LTz/P4aQZK1sS0SneOgAvhsIl3zBu8r9RevNg5lHCHAuQ/" crossorigin="anonymous"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<script>

    var pdf = new jsPDF('1', 'pt', 'a4');
    pdf.addHTML($('#pdf')[0], function () {
       // pdf.output("dataurlnewwindow");
   pdf.save('Test.pdf');
 });
</script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions