I have configured entity_print with webform for D8 and can download a submission as pdf from the submission view.
Now I tried to let anonymous users fill out a form and added a link to the pdf on the confirmation page. I checked the show own submissions for guests on the permission page of that webform.
But when I try to access the pdf with the submited data I get a permission denied message.
http://mywebsite/print/pdf/webform_submission/15?view_mode=html seems not to do the trick.
The use case just is: Display a confirmation page with the submitted values to the user and let the user download it as pdf. Any hints on that?
Meanwhile I found this Thread: https://www.drupal.org/project/entity_print/issues/2896424
Which says adding
{{ content[0]['#webform_submission'].data.FIELD_NAME }}
too the template should work. While Fieldname should be the name of the entityPdf/Attachment field.
But adding it to my webform-confirmation.htmltwig template does not return anything.
This too points in the same direction: https://www.drupal.org/project/webform/issues/3198932 This seems to be a solution. After Doing the following:
- Add permissions for anonymous users - "Webform submission: Use all print engines"
- Enable "Allow users to view a submission using a secure token"
- Add Link to submission with token [webform_submission:token-view-url]
- Submit Webform as anonymous and click on link -> Download PDF
Maybe there is still a even more neat solution...
Okay meanwhile - the so called secure token isn't expiring so it es more like a everyone how knows the link not so secure token :-(