using tokens with webform2pdf to print form submission data

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Debra G's picture

I can't figure out how to configure tokens that contain a "?", such as
[submission:all:?]
[submission:all-nl:?]
[submission:values:?]

These are tokens made available by Webform and/or Webform2pdf for inserting into the "Content of the PDF document" in the "Generate PDF" sub-tab of webforms, which appears after enabling the Webform2pdf module.

I'm using the current dev version of Webform2pdf (the current stable version has problems), along with the compatible tcpdf module and tcpdf library in a Drupal 7 installation.

Per Token's instructions, I've tried replacing the "?" with "field keys" like this:
[submission:all:regform_name]
[submission:values:regform_name]
But the generated pdf document is blank.

I know that the modules and library are working because all of the 11 available submission tokens that DON'T use a "?" - [submission:date], [submission:edit-url], [submission:ip-address] - generate data in my pdf document as expected.

It's only the ones with "?" that are giving me trouble.

Can someone explain how to implement webform-related tokens that have a "?" in them?

And what's the difference between "field key" and "option field key"? (See the Tokens Help Documentation below => the last token, [submission:values:?], calls for "field key" while the other three call for "option field key".

Thanks in advance for your help.

AVAILABLE TOKENS HELP DOCUMENTATION:
Webform submission all options
[submission:all:?]
Lists every option, and highlights which were selected from them. Replace the "?" with the "option field key", including any parent field keys separated by colons. You may append ":label" for just the label or ":withlabel" for both the label and value together.

Webform submission all options new line
[submission:all-nl:?]
Lists all of the options in separate lines, and highlights selected ones. Replace the "?" with the "option field key", including any parent field keys separated by colons. You may append ":label" for just the label or ":withlabel" for both the label and value together.

Webform submission options write new line
[submission:nl:?]
Modifier outputs all of the selected options: one below the other. Replace the "?" with the "option field key", including any parent field keys separated by colons. You may append ":label" for just the label or ":withlabel" for both the label and value together.

Webform submission values
[submission:values:?]
Webform tokens from submitted data. Replace the "?" with the "field key", including any parent field keys separated by colons. You may append ":label" for just the label or ":withlabel" for both the label and value together. Append ":key" for just the key in a key|label pair.


I'm using these module versions:
I'm using the following modules:
webform 7.x-4.3
webform2pdf 7.x-4.x-dev
tcpdf 7.x-1.0-beta1
tokens 7.x-1.6

Comments

Answered my own question

Debra G's picture

[submission:values] displays all the fields now. I'm not sure why it works now and wasn't working before.

Two differences in my configuration between today and yesterday are:
1) I formatted an webform email
2) I updated my dev version of web2form, which was updated yesterday.

displaying image in pdf

K99's picture

Hello debra, I am trying to display an image from the submitted value in my pdf content. Any idea?

Get drupal or die coding! -Me

Separator

ruslanhab's picture

I need separator between question and answer. Now I have just space between them