[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2121
  • Last Modified:

Fill in PDF values using HTML form and PHP or ASP

I'm looking at for a way to fill in a PDF using an HTML form, processed in PHP or ASP (possibly ASP.NET)

I've found a few things, but no tutorials  Any suggestions?

Thanks for your help!!!
0
slightlyoff
Asked:
slightlyoff
  • 2
  • 2
  • 2
  • +1
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
have you looked at aspPDF? It can do all of this in both classic asp and .NET.

http://www.asppdf.com/
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
and the .NET version:

http://www.asppdf.net/
0
 
Scott Fell, EE MVEDeveloperCommented:
I think php will be the way to go.   If you must use your asp code that is fine.  Set up the php file to do exactly what you need.  Then get the php page to work by accepting a form post.  When you post, in addition to the data, add some type of pass code or md5/sha hash as the pass for extra security.  Either is fine for this but you might as well use shap.    Then from your asp page, just do an xmlhttppost to the php and include your secret password or hash.  


Using fpdf http://www.fpdf.org/ there is a simple solution http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_26284685.html#a33074463

<?php
$fdf = fdf_create();
fdf_set_value($fdf, "pdf-fieldname", $value);
fdf_set_file($fdf, "http://yoursite/file.pdf");
fdf_save($fdf, "summary.fdf");
fdf_close($fdf);
Header("Content-type: application/vnd.fdf");
$fp = fopen("summary.fdf", "r");
fpassthru($fp);
unlink("summary.fdf");
?>

Open in new window


IF you don't need to save the pdf http://koivi.com/fill-pdf-form-fields/ 

Simple create your own on the fly http://www.fpdf.org/

itexthsarp
http://sourceforge.net/projects/itextsharp/
http://itextpdf.com/learn
http://www.4guysfromrolla.com/articles/030211-1.aspx
http://www.mikesdotnetting.com/Article/86/iTextSharp-Introducing-Tables
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Ray PaseurCommented:
Both PHP scripts FPDF and TCPDF (Google them) work quite well.  If you can show us the form, I can probably show you examples of how to get the information from the form into the PDF document.
0
 
slightlyoffAuthor Commented:
Thanks everyone for the help!

Basically, my goal is to ask simple questions in a PHP form that will make it easier for people to fill out complicated government forms.

So I don't want to generate a new PDF - which I've found some examples on how to do,  I just want to use the form data to fill out an existing PDF and allow the user to either save it to their computer, or print it out.  I actually don't need to save it to the server.

I will take a look at FDF Scot, as well as the ASP solution provided by Monty - although I might not be able to install anything on my ASP server (shared environment) - I can probably install something on the PHP server.

Ray, thanks for your offer to help.  I haven't created the form yet, but below I've created a simple form that would be perfect for an example:

Again, the unfilled PDF would reside on the server, but there is no need to save back to it.

  <form action="procPage.php" method="post">
Please enter your full name (last name, first name) <input type="text" name="fullName"><br>
Please state the reason for your existence (in five words or less) <input type="text name="reasonforlife"><br/>
<input type="submit" value="Send it!">
</form>

Open in new window


Naturally the form would be more complex, but I'm sure I could take it from there...

Thank you all very much for your help!
0
 
Ray PaseurCommented:
use the form data to fill out an existing PDF...
Sorry, I don't know how to do that.  Best of luck with the project, ~Ray
0
 
Scott Fell, EE MVEDeveloperCommented:
You just need to create the xml and that is what this does IF you don't need to save the pdf http://koivi.com/fill-pdf-form-fields/
0
 
slightlyoffAuthor Commented:
I was able to get someone to help - and we used FPDF.org.  Thank you for your help - and sorry for the delay in responding.
I've been trying to use different means and we finally got it set up.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now