I had such a problem, and in the end I created the .XPS file and then sent it to the printer.
From your question, it looks like you already have the process of โprintingโ the xps file, which is good, since I donโt know anything about the process of printing a rich text field into an xps file. In my scripts, I needed to print the documentation without using ms office, so I finished creating the XPS file, edited it in the code, and sent it to the printer.
This is the code I use to send the xps file directly to the printer:
LocalPrintServer localPrintServer = new LocalPrintServer(); var queue = localPrintServer.GetPrintQueue("NameOfPrinter"); PrintSystemJobInfo xpsPrintJob = queue.AddJob("name of print job", "my/xps/path.xps",false);
Also remember that for this code to work, you need to add links to System.Printing AND "ReachFramework". He took me longer than I did not forget to find out why I could not get access to the printed program.
Most printers should support this in my experience. Ordinary, and it even works on an odd "bar-printer" in our store.
source share