Posted by grey_ on February 13, 2009 at 8:08pm
8 followers
Jump to:
| Project: | Fill PDF |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Is there a plan to make this work with http://drupal.org/project/webform again?
Perhaps anyone know a good way to make webform results available for download as PDF? My goal is sothe user can download his own submitted results and our questions as pdf-files. I believe the first steps are outlined in this thread http://drupal.org/node/246371#comment-1208118
Thanks for any help.
Comments
#1
I'd love for it to work in webform, but the best way to go about that is to expose webform results via tokens. I was thinking of writing a tokens-integration module for webform myself, but never got around to it (full-time work & school, ugh). Once fields-in-core comes out, this problem is solved.
So someone write tokens-integration for webform please! :D
#2
But I do plan on writing that tokens-integration module myself if I get get time (could be many moons), so yes there are plans to make it work with webform.
-------------------------
Web development & design podcast
#3
So much to look into for a noob-drupal user.. ;-)
But what your planning sounds great, and all the work done here is much appreciated!
#4
Would the Custom Token module provide the ability to create tokens that both FillPDF and Webform could access?
I'm a n00b, but having a webform where the results could be output via FillPDF would be great. Also hoping to be able to use profile fields that have been added, but so far no luck.
#5
FillPDF uses anything with tokens. Custom Tokens will work, good find!
You can use profile data only if it's exposed as tokens -- I don't know think that's the case with core's profile.module. Try nodeprofile (D5) or content_profile (D6), which uses CCK for profile fields, thereby exposing them to tokens.
#6
I have just uploaded a new module called webformtokens which exposes webform submissions as tokens. I am using it to fill PDFs with data submitted to a webform.
#7
Liam you are the man! Got one more week of hell then I'll join yall again on all your great progress
#8
Excellent, Liam! Thank you.
...here's a new question/twist -- I can open it as a new item, but thought I'd toss it out here first:
Is it possible to use PDFs as ~inputs~ to Drupal? i.e., someone opens a PDF that is a stored form on Drupal with data entry fields, fills it out, and submits it -- the form data then goes to a printable or emailable PDF using FillPDF and the fields are also entered into a webform submission.
But, instead of using the webform to define fields, the fields are filled in on the PDF itself, making use of the PDF's painted fields and formatted content.
Thus, if someone fills out a form (a tax form, a registration form, whatever) that originates in electronic PDF format, the data they enter into that form is also captured for entry into Drupal...
...any thoughts? Is it feasible/possible? (Would open a lot of cool possibilities for integrating with existing paper forms and their electronic PDF counterparts etc.)
#9
Wonderful stuff here!
Thanks!
subscribe
#10
My next TODO, reviving.
#11
ok, i plopped webform_tokens into my code (since it's not a d.o module yet, easier to update this way). It seems as though quicksketch doesn't webform_tokens in 6, and won't need it in 7 (fields-in-core), so maybe we should just include it in fillpdf instead of releasing it on d.o? What you think Liam?
Anyway, rudimentary webform support in the -dev version -- use a URL like the following:
>> http://yoursite.com/fillpdf?fid=3&webform[nid]=10&webform[sid]=1
Eventually webform[sid] will be respected, but right now (gotta change some webform_tokens code) it will always pull the oldest submission.
#12
I think it makes more sense for webform_tokens to be part of Webform instead of part of FillPDF becauase there is nothing about the module that is specific to FillPDF; any module that wants to access Webform data as a token could take advantage of this. It seems to me that the code should be integrated with the rest of Webform. When the tokens module is present, Webform should create tokens for its data.
Yes, it would be much better if the submission to draw token data from could be chosen. The project I wrote it for didn't need that, however, and I needed to get it done quickly.
#13
Yeah, you're right.. best to keep it as its own module (unless Nate decides to incorporate it into webform). Again, should be irrelevant come 7 because webform will be using fields-in-core + tokens-in-core.
For now I'm keeping the code in fillpdf (webform_tokens.inc) so I can update it frequently. I mod'd so that tokens show up on the tokens-listings, and it now respects individual submissions. So...
@everyone: -dev version has fully-functional webform support, via a URL like
fillpdf?fid=3&webform[nid]=10&webform[sid]=1@Liam: I'm thinking of keeping this in -dev until you/we get webform_tokens.module fixed up & posted on d.o? Then I can remove my manual inclusion of webform_tokens.inc & make a release. Didn't want to step on your toes if you had plans for webform_tokens. Could you per-chance review my code against your own?
#14
#15
Want to get the ball rolling, so I created a new release with webform_tokens integrated. Later once it becomes its own module, I can separate that out & make a dependency.
Added support for webforms & permissions.
#16
Automatically closed -- issue fixed for 2 weeks with no activity.
#17
Hello,
i tried the module with web forms using the URL as specified by lefnire, but I have a question about how to point to the latest submission.
My objective is to create a web forms using the homonymous module, having a user filling up the form and then generating a PDF file with Fill PDF.
Any suggestion?
thanks!
#18
Well you just have to pass latest sid into the URL. Currently you'll have to generate that in your link via PHP, something like:
<?php$form_id = 1;
$webform_nid = 10;
$webform_sid = db_result(db_query('SELECT sid FROM {webform_submissions} WHERE nid=%d ORDER BY sid DESC LIMIT 1', $webform_nid));
echo "<a href='/fillpdf?fid={$form_id}&webform[nid]={$webform_nid}&webform[sid]={$webform_sid}'>Print your PDF</a>";
?>
I'll code in a default-to-latest-sid if none is provided in the URL, next commit. I'm also still trying to find a better method than having to URL, seems it's tripping people up.
#19
cool thanks i have made just few changes to the PHP code and it works!
This modue il super!
#20
sorry about the required horrendous URL-creation. I'll bake in something simpler soon, something like
<?php l( "Print PDF", fillpdf_url($fid, $nid, $webforms) );?>. With default tabs or buttons. Soon.#21
BTW i have added the following piece of code
$webform_sid = $webform_sid +1;to print the just entered information in the webform, otherwise the script was populating the PDF with the data previously entered.
I have entered the code in the Webform advanced settings -> Additional Processing property area of webform.
#22
ok, the php api link is available now as
<?php echo l("pdf", fillpdf_pdf_link($fid=1, $nid=2, $webform=array('nid'=>3,'sid'=>4))); ?>(see README.txt), and the webform sid defaults to user's-most-recent if none is provided.Checking into that $webform_sid +1 bit, thanks gorombel!
#23
The maintainer of Webform has decided that he will not include the token-generating code in Webform. I'm glad to see things are proceeding here.
#464032: Module to expose webform submissions as tokens
#24
Long since in there. Rest is dealt with in other issues.
#25
Automatically closed -- issue fixed for 2 weeks with no activity.