plugins.pdf_output.endMetaPrintJob returns null

Hello,

when we use this code

var StartPdf = plugins.pdf_output.startMetaPrintJob(tempfile);
...
var thePdf = plugins.pdf_output.endMetaPrintJob();

the result of endMetaPrintJob() is always null, although the tempfile PDF is created and has content. Am I misunderstanding something here?

Also it seems that the PDF output of HTML stuff is not exactly what you get when we print to a printer. Especially (cell) borders are missing. Maybe somebody knows a workaround?

Thanks
Patrick

we always do this:

plugins.pdf_output.startMetaPrintJob() 
...
var pdf = plugins.pdf_output.endMetaPrintJob()
var filename = plugins.file..createTempFile('invoice', '.pdf')
plugins.file.writeFile(filename,pdf);

this does not return null

Ah, you mean as soon as I provide a file when starting the job then the endMetaPrintJob doesn’t return anything anymore? That could be, but then the sample code is wrong. Because there is suggested that you can write a file AND at the end put the pdf in a blob in one go.