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
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
Hi Max,
Single document works fine (same as using inline display). However in the loop it fails with an error which has this line as cause:Fatal error: Cannot declare class MYPDF, because the name is already in use in/var/www/vhosts/hard-gaatie.nl/httpdocs/administrator/components/com_chronoforms8/pages/chronoforms/actions/tcpdf/output.phpon line26So it seems a loop does declare the class from the mypdf again each time the action is executed.Hope you can fix this. Another issue I have is that I can't get border lines in my table within the pdf. All methods (Styling inline, separate, hmlt attributes) fail. For now I have custom code using the chronoforms tcpdf "include" (require_once(JPATH_SITE . '/administrator/components/com_chronoforms8/libs/tcpdf/tcpdf.php'). This does not break and does show borders.
Kind regards,Pim
Hi Pim
Thanks for posting the error, I fixed it and it will be included in the new update.
I could not understand the styling issue, how are you doing that ? for styling elements in the PDF you should use CSS and include the CSS inside the TCPDF content inside style tags
