Commit f21281e7 authored by Internship UKSW 2019's avatar Internship UKSW 2019

Initial commit

parent 1f492648
...@@ -115,13 +115,13 @@ class PreviewDocument extends Component { ...@@ -115,13 +115,13 @@ class PreviewDocument extends Component {
} }
handleDownloadPDF = () => { handleDownloadPDF = () => {
const input = document.getElementById('printDocument'); const input = document.getElementById('printDocument');
let subject = this.state.subject; let title = this.state.subject;
html2canvas(input) html2canvas(input)
.then((canvas) => { .then((canvas) => {
let imageData = canvas.toDataURL('image/png'); let imageData = canvas.toDataURL('image/png');
let pdf = new jsPDF(); let pdf = new jsPDF();
pdf.addImage(imageData, 'JPEG', 0, 0); pdf.addImage(imageData, 'JPEG', 0, 0);
pdf.save(subject + ".pdf"); pdf.save(title + ".pdf");
}); });
} }
showApproval = (approval) => { showApproval = (approval) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment