Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Fillable pdf Form

How can I make a pdf, accessible from a web site, such that it is a form with fillable fields (directly into the pdf)?

Then, once filled, how can the form be "submitted" to the web owners & what is the form in which they can receive it?
Avatar of Michael701
Michael701
Flag of United States of America image

In general you will need Adobe Acrobat (not just the free Adobe Reader). Acrobat is like a word processor for PDF forms. You can also insert a 'Submit' button to have the data posted to the web. If you're askign for any personal info, please post to a HTTPS: connection.

I have a project on my to do list that will require PDF forms. In some quick research I found references that Open Office can create PDF fill in forms.
Avatar of Richard Korts

ASKER

Michael701

So I am assuming that if you do this, you can house the form on a web server, have a link to open in a new window, & click "submit" on the form when finished?

All the obvious stuff.

When you click "Submit" how do you specify where it goes? Can you make it an email attachment to a set of recipients, etc.?

Or??
ASKER CERTIFIED SOLUTION
Avatar of Michael701
Michael701
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To Michael701,

I am looking at Open Office (because it's free).

I'm wondering if you can't do the same thing in MS Office (which I have).
Avatar of arnold
If this is a web form, why use PDF which you would then have to decipher.

Why not create a standard web form and have the user fillup the data there and then submit the form?
PDF fillable forms is a step that you do not need to make.
 You could output to the user the PDF document when the complete the form.
MS Office will NOT create PDF pages or forms.
Hi rkorts,

This is possible, but there's very little information about it on the Internet; personally I couldn't find much on it anyway when I was trying to achieve the same thing as you. What you need is Adobe Acrobat Pro and Adobe Live Cycle. Then, when your PDF form is set up, you'll need a server side script that processes the data. I did this with a PHP script. The PHP script sends the entire form as a PDF to the recipient, with all the data entered.

If you have Adobe Acrobat and Live Cycle, let me know and I'll help you get it working. You're also welcome to my PHP script.
I started writing the above comment a few hours ago, but got distracted with other things. You can make it so that the full, filled-out PDF form is attached (as a PDF) and emailed to one or multiple specific recipients, it's not just the data fields that are displayed, but the entire PDF. The PHP script takes care of the recipient(s). The PDF just needs to know the URL of the script.
To julianmatz

That sounds good, except for the cost.

I am proficient in php.

But I think the comment by arnold is germane. Why do a pdf at all if not needed?
There are examples where you can create a pdf using PHP.
There are many examples see if that helps
http://www.astahost.com/info/tfclt-create-pdf-php-create-fly-pdf-web-server.html

What is the end result that you want to achieve?
>> That sounds good, except for the cost.
Do you mean the cost of the Adobe software? Yeah, I agree; I wouldn't purchase it just for the form, but I had them anyway.

>> Why do a pdf at all if not needed?
I guess it depends on the situation, but yeah, if you don't need the PDF, you could just create your own web form, or use a form builder like www.jotform.com.

Anyway, here is my PHP script, in case it's useful to anyone. When you specify the URL in Live Cycle, just make sure to add #FDF at the end - e.g. http://www.example.com/pdf-mailer.php#FDF

<?php

error_reporting( E_ALL|E_STRICT );

$r = $_REQUEST;

$string = '';

//echo '<pre>'; print_r($_GET); echo '</p>';

$name = ''; //basename( $_GET['form'] );
$postdata = file_get_contents( 'php://input' );
$name = 'Application_' . date( 'Ymd_his' ) . '_' . rand( 1000, 9999 ) . '.pdf';
$file = "/var/www/tmp/$name";
$f = fopen( $file, 'w' );
fwrite( $f, $postdata );
fclose( $f );

$finfo = new finfo( FILEINFO_MIME ); // return mime type ala mimetype extension
$info = $finfo->file( $file );

if ( $info !== 'application/pdf; charset=binary' )
{
	unlink( $file );
	die( "Error: the file type you have submitted ($info) is not valid." );
}

$pdf = wordwrap( base64_encode( $postdata ), 72, "\n", true );

$recipient = 'academy@****.ie';
$cc = '****@gmail.com';
$bcc = 'info@****.ie';
$sender = 'no-reply@****.com';
$subject = 'Application Form';
$boundary = '==Multipart_Mix_x' . md5( rand( 1000, 9999 ) ) . 'x';

$headers = "From: $sender\n";
$headers .= "Cc: $cc\n";
$headers .= "Bcc: $bcc\n";
$headers .= "X-Mailer: PHP v5.3\n";
$headers .= 'MIME-Version: 1.0'."\n";
$headers .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'."\n\n";

$message = <<<__MESSAGE__

This is a multi-part message in MIME format.
--{$boundary}
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

Application form attached. For support, please contact ****@****.

--{$boundary}
Content-Type: application/pdf;
 name="{$name}"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="{$name}"

{$pdf}

--{$boundary}--

__MESSAGE__;

mail( $recipient, $subject, $message, $headers );

//echo "<h1>Thank You!</h1><hr>Your form has been received.<hr>";
//header('Content-type: application/vnd.fdf');
//header("HTTP/1.1 200 OK");
//exit;
//header('Content-type: application/vnd.fdf');

header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: http://www.example.com/thankyou/" );
header( "Connection: close" );
exit;

Open in new window