PDF download shortcode doesn't work until PDF has been exported from wp-admin

29 August, 2018 21:46:17
andy1
Topics: 6
Messages: 18
I've discovered a strange issue. I created a form with a large signature field (800x800px) in which the user can create a simple drawing for a real estate related form. The drawing maps perfectly fine to the PDF, there are no issues there.

The problem happens when I submit the form. I get a "HTTP ERROR 500", but when I check on the backend, the form submitted fine. When I use the link generated by the [e2pdf-download] shortcode, that also results in a "HTTP ERROR 500". However, if I go to the backend and export the plugin using the E2Pdf export utility, it works fine. And then when I go back to the download link on the frontend, that works too.

I've narrowed the issue down to being caused by the large signature field. When I leave the field blank, I have no issues.

Is there some kind of processing that's happening causing an error from the download link, but that get's fixed after doing the backend export? I realize this is an edge case since most people won't use oversized signature fields, but I'd be interested to know if there's an easy fix. Thanks! :)
29 August, 2018 22:05:21
E2Pdf
Support
Topics: 7
Messages: 3345
Hi.

Is it correct that you are getting 500 error when submitting form?

If so and you will remove [e2pdf-download] shortcode will the form still have issues?

500 error can be caused by many reasons. It's need to check error.log if possible. Usually there will be more info.

We remain at your service.


We would really appreciate your feedback at WordPress.org!
4 September, 2018 21:14:33
andy1
Topics: 6
Messages: 18
I turned on debugging and got this when I tried again:

[04-Sep-2018 21:00:16 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64000001 bytes) in /home/jpmadden/public_html/client-portal/wp-content/plugins/formidable-signature/signature-to-image.php on line 53

So it looks like it has to do with the size of the signature field being larger than it was intended. Is this something I would need to talk to Formidable support about?
5 September, 2018 05:20:56
E2Pdf
Support
Topics: 7
Messages: 3345
Increasing php memory limit must solve your issue. It is not enough memory while signature generation.

Yes, question is to Formidable Forms team.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
5 September, 2018 13:34:04
andy1
Topics: 6
Messages: 18
Thanks! You are correct. I was able to solve the issue by increasing the memory limit in wp-config.php. I noticed that Formidable has actually documented this issue, and they suggested decreasing the signature image resolution as an alternate solution. Here's the link in case it's helpful to anyone else: https://formidableforms.com/knowledgebase/formidable-signature/#kb-out-of-memory-after-form-submit.