I'm attempting to use the Fill PDF module to populate an editable pdf. The data source is a Drupal Webform submission. I'm specifying those values to Fill PDF using tokens from the Webform Tokens module. I have also tried this using Webform's tokens made available to Fill PDF via the Webform Rules module, which does not work at all (no PDF is generated).
With the Webform Tokens module I have partial success: I can get a PDF to fill in with non-user-submitted values from the webform (such as the submission ID and the webform component label) but user-submitted values always end up blank. For example:
I enter the following into the Value field of the PDF-Field key in /admin/structure/fillpdf/[form ID]/edit/[pdfkeyname]:
The SID of this submission is [webform:meta-sid]. The value of the form component titled [webform:meta-label-textmetest] is [webform:val-textmetest].`
For the submission in question the value of the
textmetest field is "glasstest."
I go back to /fillpdf?fid=53&webform[nid]=4&webform[sid]=10 and it now reads
The SID of this submission is 10. The value of the form component titled textmetest is .
[webform:meta-label-textmetest] tokens are being replaced, but not the token
I have confirmed that the webform's ID is indeed 4, the SID is 10, the value of textmetest for SID 10 is glasstest, and the form ID for the pdf is 53.
I know that it is trying to access a specific submission, because if I use a nonexistent SID in the URL (e.g., /fillpdf?fid=53&webform[nid]=4&webform[sid]=99) the field reads:
The SID of this submission is . The value of the form component titled is . , i.e. the SID and title don't populate for a nonexistent submission. However, I can't get at the values for any specific submission.
If I try Webform Rules enabled instead, instead using the tokens
[webform:textmetest-title], which are the corresponding tokens that Webform Rules exposes to Fill PDF, it does not even generate a PDF; I get a 500 internal server error.
Does anyone have any suggestions, either for how to make this work or for another way to get at webform values?