Commit 68a69896 by ramdayalmunda

used pdf-lib library to generate text

parent daedde51
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,6 +5,8 @@
<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/fontkit.umd.min.js"></script>
<script src="./assets/pdf-lib.min.js" ></script>
<script src="./assets/jspdf.umd.min.js"></script>
<script src="./assets/a-doc-editor.js"></script>
......
var tempDocData = []
var editor = new ADocEditor({ element: document.getElementById("user-container-for-editor") })
console.log('editor', editor)
var extractedData = null
function extractData() {
......@@ -14,23 +13,7 @@ function setData() {
}
function generatePDF(){
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)
// })
editor.generatePDF("your_doc-pdf-lib.pdf")
}
......
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