Commit daedde51 by ramdayalmunda

PDF generated from canvas

parent d056325e
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./assets/a-doc-editor.css">
<script src="./assets/jspdf.umd.min.js"></script>
<script src="./assets/a-doc-editor.js"></script>
<style>
......
......@@ -14,22 +14,23 @@ function setData() {
}
function generatePDF(){
let url = `${window.origin}/pdf/generate`
let options = {
method: 'POST',
body: JSON.stringify( editor.getContent() ),
headers: {
'Content-Type': 'application/json',
},
};
fetch( url, options )
.then( async (res)=>{
let parsedJson = await res.json()
console.log('res', parsedJson)
} )
.catch(err=>{
console.log(err)
})
editor.generatePDF("your_doc.pdf")
// let url = `${window.origin}/pdf/generate`
// let options = {
// method: 'POST',
// body: JSON.stringify( editor.getContent() ),
// headers: {
// 'Content-Type': 'application/json',
// },
// };
// fetch( url, options )
// .then( async (res)=>{
// let parsedJson = await res.json()
// console.log('res', parsedJson)
// } )
// .catch(err=>{
// console.log(err)
// })
}
......
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