如何使用Javascript或PHP将Web表单导出为PDF [重复]

This question already has an answer here:

If I missed a similar question, I'm truly sorry - I have done what I believe to be quite a bit of digging on this subject and come up empty handed.

Is it possible (or practical) to do one of the following:

1) Use the data from a web form to populate fields in a PDF?

or 2) Simply upload the PDF and allow the user to complete and submit it online?

I don't necessarily have a preference between the two, other than the most practical solution.

</div>

mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF, with a number of enhancements.

check it out MPDF1