'I am trying to take a screenshot of the entire table but getting an error
I am trying to take a screenshot of the entire table but getting an error TypeError: _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default.a.convert is not a function
const handlePDF = () => {
var doc = new jsPDF("p","pt","a4");
doc.html(document.querySelector("#content"), {
callback: function(pdf){
pdf.save("mypdf.pdf");
}
})
};
return (
<div style={{ marginTop: "100px" }}>
<table className="styled-table">
<table id="content"/>
<thead>
<tr>
<th style={{ textAlign: "center" }}>No.</th>
<th style={{ textAlign: "center" }}>Table Entry</th>
</tr>
</thead>
{!sort && (
<tbody>
{Object.keys(data).map((id, index) => {
return (
<tr key={id}>
<th scope="row">{index + 1}</th>
<td>{data[id].tableentry}</td>
</td>
<button className="btn btn-pdf" onClick={handlePDF}>
Save PDF
</button>
<br />
export default Home;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
