My script uses the exportFile to get files PDF. Usually this is a fairly lengthy process.
When you run the script sometimes disappear from the exported files attached pictures PDF. If at the time of export of the user presses any key on the keyboard is a strange case. From this point on the attached PDF-images disappear from the resulting exported PDF. The same thing occurs during the print to PostScript file.
I wrote a little sketch showing the problem. You can download it here: http://zalil.ru/34525491
Is not there a way to avoid this?