It's just heavy.. You can do it in the background using queues to make the UI faster. You can also look at https://github.com/barryvdh/laravel-snappy which might be faster then dompdf
If you keep having problems, you can try https://www.inventivedesigners.com/document-generator This tool can do massive invoice generation in PDF or in other formats. It can do what you describe above. Good luck!
I did something similar long ago. I chose to have the invoice as a PDF form (define text fields in the PDF for all dynamic texts) and then generate an FDF file from PHP. The FDF file is basically a file saying stuff like "Field 1 should contain 'Company Inc', field 2 should contain 'John Doe'", and so on.
I then used "pdftk" on the server to combine the template pdf with the form data, and output a single file with all the fields correctly in place. This worked very well, and was quite fast too. You could probably generate a bunch of FDF files and then trigger some batch-job that converts all of them into separate invoices.
I know it's maybe not always possible to install server side software, but if you have that possibility maybe this could be an option.
ErikEklund said:
I did something similar long ago. I chose to have the invoice as a PDF form (define text fields in the PDF for all dynamic texts) and then generate an FDF file from PHP. The FDF file is basically a file saying stuff like "Field 1 should contain 'Company Inc', field 2 should contain 'John Doe'", and so on.
I then used "pdftk" on the server to combine the template pdf with the form data, and output a single file with all the fields correctly in place. This worked very well, and was quite fast too. You could probably generate a bunch of FDF files and then trigger some batch-job that converts all of them into separate invoices.
I know it's maybe not always possible to install server side software, but if you have that possibility maybe this could be an option.
https://github.com/mikehaertl/php-pdftk
Edit: oh wow, didn't look at the date before posting, still good for reference.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community