Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

blackfenix's avatar

How to generate PDF from form?

Hello. While studying Laravel, I see a lot of articles about domPDF for generating a pdf file, I looked at how to generate the controller itself, how to generate an html file, but I just can’t find any post/information - how can I generate a pdf from the data of the filled form? For example, a user filled out some kind of survey, etc., and at the end, when the submit button was pressed, a pdf file was downloaded from the data that he filled out in the form. Can someone help me aobut it?

0 likes
4 replies
Sinnbeck's avatar
  1. Create a new with the exact data you want in the pdf.
  2. Once that looks exactly how you want, pass the view to domPDF
1 like

Please or to participate in this conversation.