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

Initial commit

parent cc7d8f05
......@@ -3,8 +3,8 @@ import queryString from 'query-string';
import axios from 'axios';
import { Button } from 'reactstrap';
import ReactLoading from 'react-loading';
import * as html2canvas from 'html2canvas';
import * as jsPDF from 'jspdf';
// import * as html2canvas from 'html2canvas';
// import * as jsPDF from 'jspdf';
import './DocumentManagement.css';
class PreviewDocument extends Component {
......@@ -116,13 +116,13 @@ class PreviewDocument extends Component {
handleDownloadPDF = () => {
const input = document.getElementById('printDocument');
let title = this.state.subject;
html2canvas(input)
.then((canvas) => {
let imageData = canvas.toDataURL('image/png');
let pdf = new jsPDF();
pdf.addImage(imageData, 'JPEG', 0, 0);
pdf.save(title + ".pdf");
});
// html2canvas(input)
// .then((canvas) => {
// let imageData = canvas.toDataURL('image/png');
// let pdf = new jsPDF();
// pdf.addImage(imageData, 'JPEG', 0, 0);
// pdf.save(title + ".pdf");
// });
}
showApproval = (approval) => {
let approvalDocument;
......
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