Can we use the angular window.print() to create a pdf without printing it?

Viewed 47

I'm trying to convert some specific divs into pdf but can't seem to make it. I'm using jsPDF and here's what I have so far.

makePdf() {
    const pdf = new jsPDF('p', 'pt', 'a4');
    pdf.canvas.height = 1920;
    pdf.canvas.width = 1080;
    const self = this;



    pdf.html(this.el.nativeElement, {
      callback: (pdf) => {
        pdf.save("Summary.pdf")
      }
    })
  }

I can create a print profile and print the divs I want using window.print(). And when printing a pdf gets created. I was wondering if there's any way I can get the pdf without going fo printing

0 Answers
Related