如何创建pdf文件并从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.