I am currently using Aspose.Words for .Net. After some Google searches I landed on the page with the guide ‘How to Print a Document on a Server via the XpsPrint API’. The article was quite helpful and I clicked on the link on the top to download an example of how to use XpsPrintHelper. However, once the package had been downloaded and extracted, I could not find any reference to XpsPrintHelper in the examples. Can you please guide me in the right direction where I can find such an example?
Thanks for your reply. I don’t know if I’m doing something wrong but the link that you’ve provided in your reply doesn’t lead anywhere and I get the Page Not Found error.
Thanks for your inquiry. The link works fine at our end. We have attached the source code of XpsPrintHelper.cs with this post for your kind reference. Please let us know if you have any more queries.
//
Open a sample document in Aspose.Words.
Aspose.Words.Document document = new Aspose.Words.Document(dataDir + "Print via XPS API.doc");
// Specify the name of the printer you want to print to.
const string printerName = @"\\COMPANY\Zeeshan MFC-885CW Printer";
// Print the document.
XpsPrintHelper.Print(document, printerName, "test", true);
// ExEnd
Console.WriteLine("Printed successfully.");