Create a PDF of a signed form

Okay.

1 Like

But how would you overlay an HTML form over this?

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.

1 Like

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?

:+1:

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.

4 Likes

You could print the page (ctrl/p) and save it as PDF. I have DoPDF which acts like a printer that will print to PDF.

1 Like

Could it be because you were unclear? :smile:

[quote=ā€œcpradio, post:23, topic:215387, full:trueā€]

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

Is that what you were trying to say?

(Oh the sarcasm!)

1 Like

No, that is exactly what I said. The key words were POST in the Form Post data (meaning the data had been submitted) :smile: 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.

3 Likes

Any reason why you recommend pasting things into MS Word and creating the PDF template, versus just creating a PDF from the webpage itself?

Just trying to really understand things.

1 Like

You have a choice of either using a PDF and overlaying things on it or of creating the PDF entirely from scratch.

I(f you want the form to look exactly like the web page then create the PDF from that.

1 Like

Okay, thanks.

1 Like

Any reason why you liked 14 posts in this thread, @oddz? (My entire inbox was full of likes from you!)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.