简体   繁体   中英

Saving a PDF output of Flask Web app after completing a form and signature

I have a flask app that delivers a web-page with a signature canvas. I need to save a PDF output of this document, with signature, to a MySQL database. I am currently using Flask, Javascript and SQL Alchemy but am open to other options if it will make the end result easier. The print to PDF function in Chrome accomplishes this perfectly, just need to automate it and get it to the server. Any suggestions would be greatly appreciated!

到目前为止的应用程序屏幕截图

Since there is no much information available, i'm going to try to help a bit. First store that canvas in BASE64 data and send it back to server in ajax request or append field in your form for sending it on form submit.

Here is some piece of code for javascript:

let canvasPayload = canvas.toDataURL();

hope this helps a little.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM