Solved

Fillable pdf Form

Posted on 2012-04-05
11
573 Views
Last Modified: 2012-08-13
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?
0
Comment
Question by:Richard Korts
  • 3
  • 3
  • 3
  • +1
11 Comments
 
LVL 19

Expert Comment

by:Michael701
ID: 37816363
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.
0
 

Author Comment

by:Richard Korts
ID: 37816473
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??
0
 
LVL 19

Accepted Solution

by:
Michael701 earned 500 total points
ID: 37816552
Just FTP the form.pdf to your website. A standard <a href='form.pdf'>My form</a> should cause any browser to open the file with the client installed pdf reader.

When you create the 'submit' button, there are options to specify where to post the data. I do not recommend email, first because it's not secure, second is because the data fields ONLY will be displayed, making it hard for you to read.

Do you think you will use Acrobat or Open Office?
0
 

Author Comment

by:Richard Korts
ID: 37816861
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).
0
 
LVL 76

Expert Comment

by:arnold
ID: 37816881
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.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 19

Expert Comment

by:Michael701
ID: 37816901
MS Office will NOT create PDF pages or forms.
0
 
LVL 21

Expert Comment

by:Julian Matz
ID: 37816962
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.
0
 
LVL 21

Expert Comment

by:Julian Matz
ID: 37816981
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.
0
 

Author Comment

by:Richard Korts
ID: 37816986
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?
0
 
LVL 76

Expert Comment

by:arnold
ID: 37817071
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?
0
 
LVL 21

Expert Comment

by:Julian Matz
ID: 37817193
>> 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

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now