0

So I am given a task to make this possible it if it. We have a website where there are forms available for grabs and print. Now the supervisor wants it if its possible that the agents when grabbing the form, doesn't need to print the form. But just fill up from there and submit the form thru PDF again with details already in it. Is this possible with PHP?. I am attaching on of the forms.

https://docs.google.com/file/d/0B3yAPZizyWCCYWkwWHdrdzBBdFU/edit?usp=sharing

Ey Jay
  • 75
  • 1
  • 8

3 Answers3

1

Why would you need to use PHP at all? You can make editable pdf forms. I've downloaded the attached form and, unfortunately, this is not already editable but reconverting them to editable PDF is easy. The most common solution to convert standard pdf to editable pdf forms is acrobat: the guide to do so is here. However, you may find some free or ad-supported services which allow you to do the same thing on the internet. With some googling I've found pdfescape.com. Try to create a new document in pdfescape.com and, under the "insert" menu, choose "Form Field". That's it: you've just added an editable field to your page. Now click the "Save and Download" icon.

Once you've done with converting your pdf document from static to editable, you can distribute the pdfs to the agents and they can compile and save the form with free programs. On Mac OSX I can do that with the default image viewer. On Windows you'd probably need Acrobat. Still, they'll be able to download the pdf, compile the form, save and submit back the compiled form.


If you really want to do this with PHP, have a look at the documentation and try to figure out yourself how much time such a task would require, considering you should tell PHP where exactly to write text (in pixels) on the form and handling all exceptions (such as too long text) yourself. Here.

Also, doing that in PHP would require you to parse the pdf file into php and THEN create a new pdf out of it. Good luck doing that!

Community
  • 1
  • 1
Saturnix
  • 10,130
  • 17
  • 64
  • 120
1

This is definitely possible. You'll have to be careful about the security (since you're passing tax ids), and you'll need to let the users know that they'll have to use Adobe Acrobat Reader to submit their completed form.

  1. On the form itself use Adobe Acrobat Pro to create custom form fields.
  2. Set the document to allow saving in Acrobat Reader
  3. Create a button in Acrobat Pro on the document to submit the entire PDF as a PDF file to your server. Here's a link explaining how.
  4. On the server where you want the PDF to go, then you would install a trusted certificate from a CA. This should allow transmission through SSL from Acrobat.
  5. Additionally once the user has completed their form you can supply a link where they can upload the form through SSL (if they don't want to use Acrobat to complete the fields). (An example might be someone printing out the file to sign it.)

You can also set the file up to send as an HTML post as well. You would need to work out the legal aspects of using a signature for this though.

Remember that e-mail is not secure, so having users submit a completed form through e-mail could compromise their identity.

Community
  • 1
  • 1
AbsoluteƵERØ
  • 7,816
  • 2
  • 24
  • 35
0

1)if i open the pdf form in browser ,am not able to get the post of pdf form in my phpscript

2) if i open the form in adobe acrobat then am getting the post in $_POST variable.. below is the my php script..

According to me $_POST varibale is not working when opening the form in web browser..

<?php 
include "connection.php";
echo '<pre>'; print_r($_POST); echo '</pre>'; 


$sql = "INSERT INTO persons (name, city, state, country)VALUES('".$_POST["name"]."','".$_POST["city"]."','".$_POST["state"]."','".$_POST["country"]."')";

if($conn->query($sql) === TRUE) 
{
  echo "New record created successfully";
}else 
{
  echo "Error: " . $sql . "<br>" . $conn->error;
}

?>

gdd
  • 3
  • 4