multiple pdf's and mail

When I try to write a pdf to a temporary file and mail that pdf as an attachment all goes well (I pause the script for 2000ms just to be sure but further no problem anymore)…

When I do the same with more than one pdf in a loop, all pdf’s are broken. Even with a 5000 ms pause…

Can we solve this with the temp file in memory and a boolean reported back from the pdf writing plugin? Or is this just not possible?

download the latest version of the pdf plugin (see post [u]beta plugin[/u])

//to print multiple forms to one pdf document (to store in dataprovider).
plugins.pdf_output.startMetaPrintJob()
controller.print(true,false,plugins.pdf_output.getPDFPrinter());
forms.otherform.controller.print(true,false,plugins.pdf_output.getPDFPrinter());
mediaDataProvider = plugins.pdf_output.endMetaPrintJob()

Jan, thanks for this solution.

  1. When I take out the sleep period the result is the same as with the sleep period.
  2. Sending one e-mail gives a good result…
  3. Sending two e-mails in a row gives me a broken pdf in the first! And a correct pdf in the second email. So here the result is not yet perfect…

Hope we can solve this but so far so good for the rest…