question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when trying to generate pdf with fromHtml

See original GitHub issue

version of jsPDF jspdf@1.3.5 installed via npm, with installed typings for angular2

Have you tried using jspdf.debug.js? no

Steps to reproduce when this piece of code is called :

import * as jsPDF from "jspdf";
...
downloadPdf() {
 let doc:jsPDF = new jsPDF();
 let source:HTMLElement = window.document.documentElement;
 doc.fromHTML(source, 5,5);
 doc.save('test.pdf');
}

the following error appears in the jspdf.min.js. Only for generating pdf from html when sent as string or HTMLElement, for ordinary text it works fine. screen shot 2017-11-01 at 11 33 56 am

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
yannickbuntsmacommented, Feb 2, 2018

Whoops, indeed I missed a parenthesis!

1reaction
Uzlopakcommented, Feb 2, 2018

@yannickbuntsma How could this be correct if it is obviously wrong syntax?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when trying to generate pdf with fromHtml #1499 - GitHub
Have you tried using jspdf.debug.js? ... the following error appears in the jspdf.min.js. Only for generating pdf from html when sent as string...
Read more >
Error when trying to create pdf from html using jsPdf
I got a error when i try to create pdf from html using jsPdf. ... ng:///AppModule/TemplateComponent.ngfactory.js:198 ERROR TypeError: Cannot ...
Read more >
Problem generating PDF from HTML inconsistent | OutSystems
When generating a PDF of a report it fails most of the times with the error "Problem generating PDF from HTML, URLs:".
Read more >
Create PDF does not work, results in error | Firefox, Chrome
Open Acrobat, and create a PDF from any file (Word, Excel, PPT, HTML, or text). Try again to convert an HTML page to...
Read more >
Failed PDF Conversion: 5 Common Errors and Fixes - Inkit
Error messages and mistakes range depending on what software you use to convert a web page to PDF. Manual rendering tools often cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found