1

I am trying to convert html content to pdf report using jspdf.

Here is the typescript code.This works fine for small html content.

download() { const doc = new jsPDF('p', 'pt', 'a4'); const seh = { '#editor' : function (element, renderer) { return true; } }; const content = this.cont.nativeElement; const cont = content.innerHTML.toString(); doc.fromHTML(cont, 15, 15, { 'width': 180, 'pagesplit': true, 'elementHandlers' : seh }); doc.save('terms&conditions.pdf'); } 

But for the large html content it fail.I added the pagesplit true property for options but it also does not work.

I tried Convert HTML to PDF in Angular 6 this url. But it also does not work for large html contents.

Is any one can describe how to fix this issue. it will be great helpful. Thanks in advance.

1
  • 1
    The correct way to build your html content`s pdf is to create your dynamic html at code level and then convert it into pdf. Please see this pdfkit.org Commented Jan 30, 2020 at 8:04

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.