Apache OpenOffice (AOO) Bugzilla – Issue 73327
oo hangs when printing multiple documents
Last modified: 2013-02-24 21:07:47 UTC
When printing in OO2.1 using .NET and C# if function for printing is called from another thread while first thread hasn't finished printing OO hangs. Workaround is to use locking so that only one thread can access the print job, but this is only localized at application level. I guess OO can still hang if he gets a job from another application. Code example: public bool PrintDocument() { lock (sync) { try { XPrintable xPrint = (XPrintable)xTextDocument; PropertyValue[] pv = new PropertyValue[1]; pv[0] = new PropertyValue(); pv[0].Name = "Wait"; pv[0].Value = new uno.Any(true); xPrint.print(pv); } catch { return false; } } return true; }
We know that OO is not threadsafe and we are working on a solution. Your described workaround looks fine for me. You can alternatively use mutliple office instances to print multiple documents in parallel -> server use case. But this issue is currently not fixable, sorry. A solution is hopefully coming soon. UNO itself can be threadsafe programmed but the underlying (historical) office code can't and cause often this kind of problems.
close