0

Currently i am only able to convert html to pdf,css is not being taken into consideration. Following is the code:

javascript

$(document).ready(function () {
    $("#pdfview").click(function () {
        var doc = new jsPDF('p', 'pt', 'a4', true);
        doc.fromHTML($('#myModal').get(0), 15, 15, {
            'width': 500
        },
        function () {
            doc.save('QuickLookResume.pdf');
        });
    });
});

<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.debug.js"></script>

Below is the html I am trying to convert for reference everything is happening except the css part.

<div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog modal-lg">
      @*HtmlBOdy*@
      <button type="button" class="btn btn-black btn-sm" id="pdfview"  >PDF</button>
    </div>
</div>
redhotspike
  • 1,056
  • 5
  • 17
  • 39
  • Possible duplicate of [Exporting PDF with jspdf not rendering CSS](https://stackoverflow.com/questions/25946275/exporting-pdf-with-jspdf-not-rendering-css) – Jehanzeb.Malik Aug 27 '18 at 18:31
  • but my image is rendering fine just the colors and the alignment are not coming in pdf – Shashish Jha Aug 29 '18 at 08:54

0 Answers0