1 person found this helpful
It seems that once the print dialog is opened the script delegates handling
it to the OS and just continues running, and since the print function has no
return value I don't think it's possible to pause the script until the print
window is closed.
Ok, unfortunately, but still thank you.
When I use only "print(true);" it will print the document as is. Whenever I add the launchURL part, the document will print, but seems corrupted.
I try to print the word "test5", but the printed document contains the word "uftu5" with some strange letter spacing. Is there a way to fix this then?
I'm not sure I understand what you mean. Do you mean that you have the word
"test5" in the document, but it prints something else? If so, it sounds like
a font problem. Make sure all fonts are embedded in your document.
That is correct. The document has the word "test5" and it finally prints "uftu5".
When I create the document without app.LaunchURL('http://www.google.nl'); it works as expected. So the fonts seem to be okay.
When adding app.LaunchURL('http://www.google.nl'); the page will redirect before actually printing. So when hitting the print button in the print dialog, the PDF has already been replaced by the Google webpage. Printing will take place based on a PDF file available only in memory.
Have no idea... Sorry.
Some new info has appeared:
I've tried larger files. It seems to occur only on lines with strange characters like 'ë' or '>'. It indeed suggests problems with my font. But even then, why is it only happening when the JS "app.launchURL('http://www.google.nl'); is implemented?