public static void Print(Document document, string printerName, string jobName, bool isWait)
{
Console.WriteLine("Print");
if (document == null)
throw new ArgumentNullException("document");
// Use Aspose.Words to convert the document to XPS and store in a memory stream.
MemoryStream stream = new MemoryStream();
document.Save(stream, SaveFormat.Xps);
stream.Position = 0;
Console.WriteLine("Saved as Xps");
Print(stream, printerName, jobName, isWait);
Console.WriteLine("After Print");
}
// ExEnd:XpsPrint_PrintDocument