parallax/jsPDF

JsPdf is saving a pdf but takes too long time to show it in google chrome

Open

#3.137 geöffnet am 19. Apr. 2021

Auf GitHub ansehen
 (20 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)JavaScript (4.596 Forks)batch import
difficulty:hardhacktoberfesthelp wantedpersistent

Repository-Metriken

Stars
 (28.280 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

I'm using JsPDF to download an html styled element, but when it is downloaded, it takes too long to be showed in google chrome as pdf (shows just an empty pdf document at first and charge it after long time),

the size of the file is only 300KB, I don't know why I have this problem however it's showed correctly in mozilla firefox browser

Please do you know how could I solve this problem.

this is my code

generatePDF = () => { var doc = new jsPDF('p','pt',"a4"); const inp = document.getElementById("cv"); doc.html( inp , { html2canvas: { scale: 0.75, }, callback: function (doc) { var pageCount = doc.internal.getNumberOfPages(); doc.deletePage(pageCount) doc.save("download.pdf"); } }); }

this is the pdf file: downloaded.pdf

Contributor Guide