I have always found issues with the PDF plugin in its use of 2 years now.
I have some scripts which run in the background and goto a form, print it to a meta print job and store it as a pdf.
Originally my issue was the on some occasions a signature jpeg at the bottom just appeared sometimes as rendered and sometime as an ‘@012hshsss’ array type of data.
I fixed this by putting the same graphic as a 1X1 pixel object at the top of the form 8 times. This made sure that all the time my signature at the bottom came out. My unsubstantiated principal was that by delaying the printing of the document the final signature would get rendered. Indeed it was interesting because the jpeg was about 12K, and when you looked at 10 prints of the document to pdf the size varied from 20K to 120K. i.e the rendering of all of the jpg images was intermittent. I also think the jpg are rendered in parallel, hence the more you put in the more chance you have of getting the last one (the one i wanted!) actually rendered.
The reason i post this, is that i have recently notice on my invoices that i have been getting an intermittent difference in an html label at the bottom, coming out as raw html and sometimes as coherent rendered html.
When i go to the layout and hit print to pdf it works fine. When i run an automated script that goes to the layout and prints but does not show it, then i sometimes get raw html on my pdf.
I suppose the way around this remains the crude way i have achieved it above, or alternatively show the form. put a pause in of 1 seconds maybe and then running the print statement.
Alternatively it would be more elegant to be able to tell the print statement to delay the printing for a second in order to let servoy render the form.
If this is all gibberish then please ignore it, but for those of you printing forms into PDFs it may be useful, because there is definitely a phenomenum where forms.Sales_Invoice_Print.controller.print(true,false,plugins.pdf_output.getPDFPrinter()); is to quick to print as servoy has not rendered the fields, labels, or images on the form!
David