Issue
I want to convert html to pdf using jspdf but i want to generate the pdf without showing the html content to users. The technology im using is ionic. Please help on this issue
Solution
  public downloadPDF() {
    const doc = new jsPDF();
    const specialElementHandlers = {
      '#editor': function (element, renderer) {
        return true;
      }
    };
    const content = this.content.nativeElement;
    doc.fromHTML(content.innerHTML, 15, 15, {
      width: 190,
      'elementHandlers': specialElementHandlers
    });
    doc.save('test.pdf');
  }
Example: https://stackblitz.com/edit/angular-html-to-pdf-example
Answered By - Pranam Bhat
 
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.