Commit 075dac3f authored by Open Source Developer's avatar Open Source Developer

trans

parent e2907ab6
......@@ -214,7 +214,7 @@ import * as fs from "fs"
}
createPdf()
createPdf1()
{
html2canvas(document.getElementById("target")).then(function(canvas)
......@@ -224,21 +224,6 @@ import * as fs from "fs"
if(document.readyState === "complete") {
console.log("mphka");
var img = canvas.toDataURL();
var fs = require('fs');
var sys = require('sys');
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0"
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO"
+ "3gAAAABJRU5ErkJggg==";
var data = img.replace(/^data:image\/\w+;base64,/, "");
var buf = new Buffer(data, 'base64');
fs.writeFile('image.png', buf);
var doc = new jsPDF();
console.log("mphkaneo");
......@@ -255,23 +240,27 @@ import * as fs from "fs"
createPdf1()
createPdf()
{
html2canvas(document.getElementById("target"), <Html2Canvas.Html2CanvasOptions>{
onrendered: function(canvas: HTMLCanvasElement) {
console.log("lalalal");
var img = canvas.toDataURL();
var doc = new jsPDF();
doc.addImage(img, 'PNG',0, 0, 210, 297);
doc.save('applications.pdf');
},
function(error){
console.log("i fail");
}
});
}
var img = canvas.toDataURL();
var doc = new jsPDF();
console.log("mphkaneo");
setTimeout(function(){
}, 10000);
doc.addImage(img, 'PNG',0, 0, 1000, 1000);
console.log("mphkaneoneo");
doc.save('applications.pdf');
}
}); }
}
......
......@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ</title>
</head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<body>
<main></main>
</body>
......
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