Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to upload the same PDF template, that I'm using on my local machine (ubuntu) to remote server (red hat). Both have pdftk installed.
Problem is, when i upload it to remote server, it shows that there are no fields to be mapped. However, it does show all the fields on localhost.
what could be the problem.
thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
#10 | fillpdf.1430044_pdftk_path_option.patch | 4.71 KB | wizonesolutions |
Comments
Comment #1
wizonesolutionsOne of two things is happening here:
nobody
orhttpd
and type pdftk --version. Does it work (or at least does pdftk output something)?admin/config/media/fillpdf
, and thus it doesn't know which fill method to use or is trying to use one that it can't.Let me know if it's one of those. I should add these to a more visible FAQ section in the documentation and will soon.
Comment #2
turtletrail CreditAttribution: turtletrail commented1. The permissions were correct. But i changed them to 777, just in case. Didn't help.
The pdftk --version prints something like:
so i guess it cannot be blamed as not working
2. It's configured correctly
so, nothing seems to be helping for now.
Thank you.
Comment #3
turtletrail CreditAttribution: turtletrail commentedso i found the temporary solution, this was to change line nr. 585 in fillpdf.module from:
exec('pdftk ' . escapeshellarg(drupal_realpath($filename)) . ' dump_data_fields', $output);
to
exec('usr/local/bin/pdftk ' . escapeshellarg(drupal_realpath($filename)) . ' dump_data_fields', $output);
certainly, that's not the right way to do this. Can you give me a hint to point shell to the right path?
Comment #4
wizonesolutionsFrom the looks of it,
/usr/bin
simply isn't in your Web server user's path. I think your fix is about the best you could do right now besides fixing it environmentally, however that applies to your environment.I'm changing this to a feature request to allow defining the path to pdftk manually. This will remove the need for your code change. If you'd like to contribute a patch, you're welcome to. Otherwise, I will do this soon.
Comment #5
makt CreditAttribution: makt commentedThe pdftk is installed under the path usr/bin/pdftk. I changed pdftk.module (see below) but the module is still not detecting the fields within my pdf. It also says the pdftk was not installed correctly but when my hosting company tests it, it works for them. Any idea on why this would happen? Thanks!
exec('usr/bin/pdftk ' . escapeshellarg(drupal_realpath($filename)) . ' dump_data_fields', $output);
Comment #6
wizonesolutionsmakt: See http://drupal.org/node/1302596#comment-5884826
exec() might be disabled on shared hosting.
Comment #7
wizonesolutionsOh! Also, that needs to be
exec('/usr/bin/pdftk ' . escapeshellarg(drupal_realpath($filename)) . ' dump_data_fields', $output);
Note the leading slash beforeusr
.usr
isn't/usr
.Comment #8
makt CreditAttribution: makt commentedThank you! After enabling exec() & shell_exec() the module works!
Comment #9
wizonesolutionsTagging.
Comment #10
wizonesolutionsCommitted this feature to 7.x-1.x-dev. Here's the patch.
Comment #11
wizonesolutionsIf this gets backported to 6.x-1.x, it also needs to take #1876832: Path to pdftk blank if saved blank on settings page (should fall back to pdftk) into account.
Comment #12
wizonesolutionsCamp is over.
Comment #13
TolliSysDev CreditAttribution: TolliSysDev commentedI am revisiting item#6 because exec() IS disabled on my shared hosting. Is there a workaround for this? At present the /usr/bin/pdftk path is not recognized and I can't get the module to work.
Comment #14
wizonesolutionsNo, the JavaBridge/pdftk options are not intended for shared hosting. You should either use FillPDF Service or run your site off a VPS/dedicated server where you can set up the other options.
Comment #18
kenorb CreditAttribution: kenorb commentedMarking as fixed in 7.x & 8.x since Drupal 6 is no longer supported.