Dynamic creation of multiple pages with sequential numbering

Forminator Forms
17 January, 2022 03:07:48
Alain Melsens
Topics: 8
Messages: 50
Hello,
I have bought a licence to create several PDF pages. How can I dynamically create number of pages according to a number chosen in a Forminator form field?
For example: Quantity: 6
With this, can I create 6 PDF pages and have the page ID appear on each page as a sequence number: 1/6, 2/6, 3/6, 4/6, 5/6 and 6/6.
Thanks in advance.
Kind Regards,
Alain Melsens
17 January, 2022 03:41:42
E2Pdf
Support
Topics: 7
Messages: 3188
Hi,

E2Pdf Templates must have pre-created and designed pages. So you need to create 6 pages and hide them with "Actions" and "Conditionals" depending on user input. See please attached screenshots.

Screenshot 1: Creating New Pages (if not pre-uploaded PDF used) + output values as 1 / {select-1} which will be rendered as 1 / 1, 1 / 2, 1 / 3 depending on user input.

Screenshot 2: Action set to "Hide" 2nd page.

Screenshot 3: Action set to "Hide" 3rd page.

For other pages the process will be similar.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
17 January, 2022 03:47:13
Alain Melsens
Topics: 8
Messages: 50
Hi,
Thanks for your fast reply.
You wrote at: "Screenshot 1: Creating New Pages (if not pre-uploaded PDF used) +..." but when creating many pages, it seems not possible to use "pre-uploaded PDF pages". Or what do you mean by "(if not pre-uploaded PDF used)"?
17 January, 2022 03:51:48
E2Pdf
Support
Topics: 7
Messages: 3188
When you are creating E2Pdf Template you can choose "Empty PDF", "Upload PDF" or "Auto PDF".

So when you use "Upload PDF" - it's not possible to add new pages from E2Pdf Visual Builder directly. In this case all additional pages must be already created in PDF source which will be used for creating E2Pdf Template. It will be still possible to apply "Actions" and "Conditions" to hide that additional pages.
We would really appreciate your feedback at WordPress.org!
17 January, 2022 08:00:41
Alain Melsens
Topics: 8
Messages: 50
Hi,
This works very well. Unbelievable what is possible. Perfect as expected. Excellent E2PDF plugin.
Ticket may be closed.
Thank you very much for this wonderful and fast support.
Kind Regards,
Alain Melsens
21 January, 2022 09:38:51
Alain Melsens
Topics: 8
Messages: 50
Hi,
Sorry, but I have another question about this.
I am trying to use a numeric Forminator field, so a {number-1} value instead of a {select-1} field to specify the number of pages.
But this does not seem to work. I constantly get the following error message:
Unexpected server response.
PDF.js v2.6.347 (build: 3be9c65f)
Message: Unexpected server response (500) while retrieving PDF "https://mysite.lcl/?page=e2pdf-download&uid=72ce8172aaf05963d861407f68b7cb5e&v=1.16.44&saveName=xxxxxxxx.pdf".
I have hidden some data here, of course.
Or can I only use a {select} field in this case?
Thanks in advance.
Kind Regards,
Alain Melsens
21 January, 2022 10:02:54
E2Pdf
Support
Topics: 7
Messages: 3188
Hi,

Unfortunately we could not replicate issue on our side, it works as expected. Can you try please to use [e2pdf-download] shortcode instead of [e2pdf-view] and check which error will be shown if you will try to access PDF?

P.S. Viewer can throw such error if PDF doesn't contain any of pages, for example if you added conditionals which makes all pages "hidden" as PDF must have at least 1 page.
We would really appreciate your feedback at WordPress.org!
21 January, 2022 10:13:53
Alain Melsens
Topics: 8
Messages: 50
Hi,
Thanks for your fast reply.
This is strange. Because, with the [e2pdf-download] shortcode instead of [e2pdf-view], I can open or download the PDF file without any problems.The contents seems also good. There are 4 PDF pages as expected.
What could be the reason why it's not possible to view the PDF in the normal way with the PDF viewer?
21 January, 2022 10:32:48
Alain Melsens
Topics: 8
Messages: 50
Hi,
I think I have found the reason myself!
Before, I did several tests with a {select} field as you illustrated earlier in your example. I need to let generate at least 20 PDF pages with QR code on it. Sometimes, I got the impression that when 20 PDF pages had to be created, it took a bit longer.
I thought that by doubling the API Connection Timout to 600 in the E2PDF Settings, this might be better?
By now modifying my Forminator form using a {number} field, I now got those problems with that error message in the PDF viewer.
I have now set the API Connection Timout back to the default value of 300 in the E2PDF Settings and now it works fine again with the PDF viewer. The error message has disappeared.
My sincere apologies for this.
What could I possibly adjust somewhere in the parameters so that the generation of PDF pages would go a little faster?
Or is that not a good idea? In which case would the timeout adjustment be useful?
21 January, 2022 10:43:18
E2Pdf
Support
Topics: 7
Messages: 3188
Timeout setting must not affect PDF generation time or produce any errors, it's just the connection time until which E2Pdf will wait response from API.

It looks like issue was with something else. Maybe you faced the problem with PHP limits? Like timeout or PHP Memory Limit?

We are doing our best to have fast PDF generation so what you can try to do:

- If you are using flatten option and it's set to "Full" - it must be used "Yes" instead.
- Try to switch API server at "E2Pdf" -> "Settings" depending on your location and check if generation will be faster.
- Try to use less images or lower quality inside PDF (if possible).

We are doing our best and trying to speed up the PDF generation process with not to loose the complex functionality which has E2Pdf.
We would really appreciate your feedback at WordPress.org!
21 January, 2022 10:59:05
Alain Melsens
Topics: 8
Messages: 50
Hi,
Thanks for the very interesting information.
I have doubled the PHP memory settings. On the other hand, I have indeed chosen an API server from EU. E2PDF will be used in a website in EU.
After testing again, it seems indeed to work more stable. The most important thing is that the PDF viewer works again without error.
Again, I would like to thank you very much for your quick and very efficient support.
This has been solved again.
Best Regards,
Alain