ES6 - how do you import either html2canvas or rasterizehtml?
See original GitHub issueI’m using v 1.3.3 and jspdf.debug.js
.
This is a mixin for vuejs, a simple function:
import html2canvas from 'html2canvas'
import jsPDF from 'jspdf'
PDF =
methods:
makePDF: () ->
pdf = new jsPDF 'landscape', 'mm', 'a4'
ele = document.querySelector '.roster-view'
pdf.addHTML ele, () -> pdf.save 'roster.pdf'
export default PDF
I expected this to work, but:
jspdf.debug.js?ece2:4049 Uncaught Error: You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js at ...
What have I missed?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
ES6 - how do you import either html2canvas or rasterizehtml ...
I 'm using v 1.3.3 and jspdf.debug.js. This is a mixin for vuejs, a simple function: import html2canvas from 'html2canvas' import jsPDF from ......
Read more >Using jsPDF and html2canvas with es6 - Stack Overflow
I 'm Importing html2canvas and jsPDF but getting an error on the addHTML when I comment out the addHTML the pdf is generated....
Read more >html2canvas - npm
Start using html2canvas in your project by running `npm i html2canvas`. There are 1794 other projects in the npm registry using html2canvas.
Read more >Javascript – Using jsPDF and html2canvas with es6 - iTecNote
I 'm trying to use jsPDF and html2canvas with es6. I'm Importing html2canvas and jsPDF but getting an error on the addHTML when...
Read more >Getting Started - html2canvas
You can install html2canvas through npm or download a built release. npm. npm install html2canvas. import html2canvas from ' ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Got it, jspdf requires html2canvas to be attached to the window scope:
How can I set
window.html2canvas = html2canvas
in Angular?I tried: .ts - File
import * as jsPDF from ‘jspdf’; import * as html2canvas from ‘html2canvas’;