And why would you want to overlay an HTML Form when my existing page already has the text and form already set up?
I already wrote quite a bit of code to grab the various parts of the contract from the database and display a unified contract. My code also inserts form fields into the appropriate sections of the contract. It looks something like thisā¦
My hope was to find something that takes what is on the screen - including form data - and PDFās it.
Maybe this is where my thinking is not correct, but isnāt there a way to either grab what is displayed on the screen, or in the $_POST and create the PDF?
I guess the $_POST would only capture the form fields submitted and not the text, right?
If I had the contract in MS Word, and I completed the form fields, and then I chose to PDF the document, wouldnāt it capture what was entered into the form fields as well?
The goal was to do the same thing for this web page.
Re-read my comments above and then try to think about it a bit more, as you obviously have no idea what Iām recommending.
What?!?! Where do you even get that Iām talking about overlaying an HTML form?
Read how to generate the word document again. I didnāt say to embed fields in the word document. I said to use underscores for where you want to insert the form data.
So letās try this again.
Leave your HTML form as is. Donāt touch it. Let it do its thing. Now, while viewing said form, open word, copy the form text (note: text, not fields), and paste it into word. Where there are fields, put underscores. Export/Save/Print it to a PDF. Now you have a generic PDF that has spots for your program/website/whatever to place text.
Now, go read my code example that I linked to.
It shows you how to load the template PDF, and then write text on top of it, thus producing a PDF that contains your terms and the user inputted data. Then you can output said PDF to a file on disk, write it to the browser so the user can see it embeded, etc.
What?!?! Where do you even get that Iām talking about overlaying an HTML form?
It sounded to me like you were telling me to take my existing contract web page, PDF, then load it as a template back to the website and then overlay the form fieldsā¦
Re-reading what you said, maybe you were trying to say thisā¦
Take your existing contract webpage
Make a PDF of it
Keep the existing contract form webpage as is
When the user complete (aka āsignsā) your existing contract webpage, then your PHP will fire off FPDF
Then FPDF will load the ātemplateā PDF you created from your existing contract webpage, and take the data from the $_POST array and stick that submitted data into the fields you define in FPDF and merge it with your template.
The existing contract webpage will be left untouched, and after it is submitted, you could display a confirmation PHP page.
In addition, you can display (or email) the new signed contract PDF you created using FPDF
No, that is exactly what I said. The key words were POST in the Form Post data (meaning the data had been submitted) that and pairing it with my sample at the link I provided, would help indicate that.
I think you know how to handle it now. It should be fairly simple just remember if you update the web version of your TOS, update the PDF template too.