Click to See Complete Forum and Search --> : PDF and Form Posts


cthulhu
12-14-2001, 11:03 AM
I'm trying to post data from an html form into a PDF Form. The PDFs already are created (from state gov't) and really can't be built dynamically on the fly (they're way to complicated in layout). What I need to do is post data from a html form to any pdf form. I know I can do this by reading a URL from within a PDF using javascript embedded in the PDF, but the problem lies in the fact the end users aren't to bright, and they will be recieving the PDFs from the state and putting them on the server. Trying to teach them to embed javascript in an already created script would be very, very hard.
I took a look at PDFLib and it doesn't seem to allow me to do this. The only other way I know of is to use ASP and acx using Adobe's sdk, but I cring at doing that because I want to use apache/linux. (activeX, ASP, isn't that a sin?) Any ideas out there?

cthulhu
12-14-2001, 11:03 AM
sorry, wrong forum.

Anon
12-14-2001, 02:30 PM
You can take the HTML form submitted data and create an FDF file that links to the PDF. When the PDF file is opened it's populated with the FDF data. Don't get sucked into using the FDF Toolkit to do this. It makes the process far more complex than it is. I have an example at http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=329 and you can read more about FDF at http://www.omnicast.net/gigowiz/computers/fdf.html.

Check out http://forum.planetpdf.com/scripts/wbpx.dll/~planetpdfforum for more.

Hank

cthulhu
12-14-2001, 03:41 PM
Oh wow... I like it. That code definitly earns you an A for creativity.
Can I say <I> you da MAN</I>

Thanks a lot. You've saved me a lot of time and pain

Anon
01-24-2002, 11:39 AM
Hello,

When I execute your script tht is located at
"http://www.omnicast.net/gigowiz/computers/fdf.html" I get this error in IE:
"Fatal error: Call to undefined function: ifx_fetch_row() in C:\inetpub\wwwroot\test\download.php on line 12"

Can you help me with this??
Can you please give me a working example which i can use as een lesson!
My php knowledge is very traggic.

Already thx

Greetingzz Freek

cthulhu
01-24-2002, 12:30 PM
<?
// *** FDF HEADER FILE ***
$fdfdata = "%FDF-1.2\n%âãÏÓ\n1 0 obj << /FDF << /Fields [";

// Each of the following is a field in a form in the PDF (field 'Name' gets data 'Ugly Smurfs')
// Simply repeat for each field. Remember capitalisation counts
$fdfdata .= "<< /V (Ugly Smurfs) /T (Name) >> ";
$fdfdata .= "<< /V (Eat salt licks) /T (WHATEVER) >> ";
$fdfdata .= "<< /V (my name is) /T (Bubba) >> ";

$fdfdata .= "]\n";

// This is the URL of the PDF we want to populate
$fdfdata .= "/F (http://192.168.0.12/Doc1.pdf) >>";

// Closing the FDF
$fdfdata .= ">>\nendobj\ntrailer\n<<\n/Root 1 0 R\n>>\n";
$fdfdata .= "%%EOF";

/*** Now we send the FDF data which causes Acrobat to start ***/
// Note: we send a header which tells IE etc how to handle it. Be sure the mime type application/vnd.fdf
// is associated with Acrobat.exe (windows explorer for IE or Preferences in Netscape)
header ("Content-Type: application/vnd.fdf");
print($fdfdata);
?>

Note: IE has a very BIG flaw. The PDF when it loads will overload the page in the parent window. This is even true
if you try to get it to load in a javascript pop-up or in a frame. The pop up will close and all frames will go away.
This means if you use transparent sessions instead of cookies you loose your session. Otherwise its not
a problem. Netscape does not have this problem

Anon
06-28-2002, 06:03 AM
If i want to populate more then one page?