简体   繁体   中英

how to create pdf file and save data to database from user input in php

i have a form that can be filled by user and having the fields, name, address, mobile number,total marks of math, science etc. when i click on submit form i should have to generate a pdf file with those user input details and save it to databse

example

Personal Information
Name :**xyz**(Input filed)

E-mail :**xyz@gmail.com**(Input filed)

Address : **xyz address**(Input filed)

City :**xyz**(Input filed)


 **Results**

Maths: 50 marks(Input filed)

English: 56 marks(Input filed)

French: 65 marks(Input filed)

Cool.. Then You can use DOMPDF

DOM PDF Example

Here is the example to generate dom. You need to include this project for php and then you can check out different examples, you'l' you solution in these examples.

Let me know if need some more help.

DOM GITHUB

As others have noted, saving a whole PDF to a database is not an effective use of resources. You might considering saving the textual data into the database, and then having a separate script generate the PDF for you by querying data from the database. I have had good luck with TCPDF for this purpose.

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