CF8 create multiple pdfs in a loop

pi pimh 1d ago

Hi Max, 

It has been a while because I got most stuff working correctly. So I am a happy user of CF8.

However some new functionality on my website requires me to generate pdf's (multiple files) based on results of a database read. For this I thought of using a loop to go through each found row and generate a pdf using the tcpdf action. However this fails. I have a path included for storing the files that uses an unique id value from the loop. So each file should be unique. However I only get 1 file in the given location instead of 4 when I set the result to store and inline. I only see one file. I expect the inline breaks more or less the loop. 

If I set the result to store only, I get a 500 error. As if the file can't be written. However the previous action tells me this is possible without failure. Is using tcpdf action inside a loop possible/allowed? And if yes, is there something that I need to do to get things working.

Kind regards,Pim

Max_admin Max_admin 19h ago

Hi Pim

First try it outside the loop, works ?

if yes then move inside the loop, and disable Inline since Inline will end processing, it should be Store only, what error do you get ?

You may also enable the Joomla error reporting to get the full error details

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply