Provide PDF form on my Website and save with fillings - php

I want to provide a PDF with a form on my Website. It is integrated with an iFrame. When the user has filled it out, it should be save with the user fillings (not empty) on a directory of my Webspace. Is there an elegant solution to this possibly using PHP? Thanks.

No.
Because you can't control what browser is used, you can't control what PDF viewer is used to fill the form. Some embedded PDF viewers won't even be capable of filling form fields. My recommendation is to collect the data using standard HTML, then populating the form using any one of the several PHP libraries that can populate PDF forms, then present that to the user and have them sort of "approve" it, at that point, you save it to your Webspace.
That said, there are solutions like Adobe Sign that will convert the PDF to and HTML5 rendition that allows you to fill the form in any browser then retrieve the data and/or a static PDF for storage on your Webspace.

Related

PHP form to PDF? Any better suggestion?

I am currently developing a web app using PHP. At first, User will fill in a form then submit the data to database, this info will display in Admin page. The Admin has to view the content of the form and do verification job.
Previously, after User fill in data, I convert the form to PDF using FPDF library and save the PDF in database instead. Now, I am developing the web app under AWS services. I wonder if there is any better option to do the job.
Should I save the form data in different columns or convert them to pdf before inserting into database (MySQL)? Is FPDF a good option to convert? Or there is any other library?
Thank you.

Edit FormCentral online and save to server

So my server loads in a pdf and shows it.
This pdf contains forms to fill in.
I want these forms editable in the browser(Currently I use an embed for the pdf) and then a button to save the pdf(To the webserver, not to the client!).
The reason I don't make an html form out of it is because there are 5 different pdf's to do this to and total of 60 pages of inputs to fill in
Any ideas on this?
EDIT: This is created with Adobe Forms Central

Excel form on a web page

I'm working on a project a little special and I have to insert an excel form on a web page so that users can fill it online and then on submit it have to be sent by email (as attachment or form) to the recipient of the form.
The company has no skydrive and the form must be an excel and not an HTML form.
Does anyone have an idea?
Thanks all !
I'm the creator of Appizy (http://appizy.com) that aims at converting Excel files into dynamic webapp. If I get it well you could generate your HTML form based on Excel Spreadsheet with Appizy.
Then you "just" need to plug a submit button to the generated webapp to send the data by email.
PHPExcel seems to offer a fully fledged engine for PHP (including calculating ability).
There doesn't seem to be any clear cut examples of how to interact with it via a webpage however.

Is this possible? From PDF to Editable Forms

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
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!
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.
On the form itself use Adobe Acrobat Pro to create custom form fields.
Set the document to allow saving in Acrobat Reader
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.
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.
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.
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;
}
?>

manipulate pdf form with fill-able form fields and keep them fillable by user?

I got a form with fill-able form fields made by Acrobat, it is rather complex.
Via PHP I want to "simply" attach another page, add a barcode to the form page and add meta info.
Currently I do not manage to retain the fields fill-able or tcpdf/fpdi simply cannot read the compression of the pdf. I tried a couple of different pdf version but don't succeed so far.
I tried pdflib but work now with tcpdf and fpdi, however there seems no way to make it happen.
I can attach pdf files and use templates, just not in any format that has or retains fill-able fields.
Is tcpdf/fpdi able to do this at all?
Do you know of any other solution to achieve this? (PHP/linux based)
What you want to do is not possible.
Adobe uses an own proprietary way to create and fill PDF forms. Adobe Reader does only support to fill PDF forms...
...which were created by an Adobe product and
...which have been assigned 'extended rights' so Reader can indeed save the formdata alongside the document.
There are a number of methods, utilities, tools and programs to create and fill PDF forms nevertheless: Scribus, iText, pdflib, tcpdf, pdftk, Foxit, XSL FO, OpenOffice.org or LibreOffice and more... However, Adobe Readers will refuse to fill+save form data with documents created by these means.
The technical mechanism behind this is: Adobe digitally sign their form documents with their own key. This key is known to the Adobe Reader and all Adobe Products. And you agreed to not reverse engineer that key when you accepted the Adobe Reader EULA.... --
This means:
Most non-Adobe PDF Readers will not be able to 'fill+save' forms created with Adobe products (they can 'fill+print' them however), unless they may have licensed from Adobe said signature key.
Adobe PDF readers will refuse to 'fill+save' forms created with non-Adobe products (they will 'fill+print' them however).

Categories