Since I have to process a document before printing or saving it as doc or pdf (to convert inlineui to span text), I'm trying to do it all on a backgroundworker to avoid locking UI.
Unfortuntantly I'm getting an exception on the format provider export (wich is called during the background code).
I have a variable with the Raddocument and I'm converting it to xaml using:
IDocumentFormatProvider exporter =
(MemoryStream stream =
StreamReader reader =
result = reader.ReadToEnd();
the cross-thread exception occours on the line exporter.Export(document, stream);
Is there any way to solve this?