LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2007, 05:34 PM   #1
jb8578
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Rep: Reputation: 0
PDFTK, php, & fill_form


Anyone know how to save a form filled PDF to the server rather than outputting to the browser in PHP?

I have a script that merges PDFs, saves the file and then gives the browser the option to open or save:

exec("pdftk " . $str . " cat output audit.pdf");

I also have a script that takes form data and merges it to a PDF, *BUT* it only outputs to the browser:

passthru("pdftk form.pdf fill_form " . $fdf_fn . " output - flatten");

What I want is to just save the PDF file on the server after the user submits the form data.

I was thinking to try this:

exec("pdftk form.pdf fill_form " . $fdf_fn . " output application.pdf flatten");

...but this doesn't work. I would think removing the passthru() and "output -" would fix it since those are used if you just want a temp file to load into the browser. Any ideas ?

Thanks.

Last edited by jb8578; 02-07-2007 at 05:35 PM.
 
Old 02-08-2007, 10:57 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

exec("pdftk form.pdf fill_form " . $fdf_fn . " output application.pdf flatten");

It doesn't work you say. Do you have any idea why it doesn't work? When you call exec like that, you lose any error message. It could be a permission problem? Does the webserver have permission to write to "application.pdf"? I'd change the exec into a passthru to see if I could read the error message.
 
Old 02-12-2007, 03:48 PM   #3
jb8578
LQ Newbie
 
Registered: Dec 2006
Posts: 14

Original Poster
Rep: Reputation: 0
thanks. you were right, it was a permission error.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP & Apache - php files not processing aolong Linux - General 1 12-17-2006 03:09 AM
Slackware guide for AMP Apache MySQL & PHP xushi Slackware 35 05-11-2006 11:18 AM
php-devel & PHP extensions EHCanadian Mandriva 0 06-23-2005 06:06 PM
PHP & MySQL Count on PHP Gerardoj Programming 1 06-01-2004 10:43 AM
From RedHat9 to FreeBSD (Apache 2 & Mysql & PHP 4) guardian653 *BSD 5 12-11-2003 05:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration