We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Document.Print Fails - Error says "The Operation has completed successfully"

We have incorporated Aspose.Words into our .NET application to perform mail merges and print resulting documents.

A customer is experiencing a printing error that I have been unable to resolve.

The C# code in question is :

try
{
doc.Print(printerSettings);
}
catch (Exception e)
{
log.Error(e.Message, e);
}

When I look at the log e.Message was "The Operation has completed successfully"

The printer being used looks OK and I can print to it with Notepad.

Can you help please?

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you attach the document you are getting issues with? I will check the problem on my side and provide you more information.

Best regards,

Before I try to get the document from the customer let me say that it prints OK on a different printer.

I trap for " no printers are installed" and "settings to access printer" errors so I know that the printer name is correct.

Does this help?

Thanks,

Mike

Hello Mike

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Please try running the following code. This code does not use Aspose.Words at all. So if it will not work, the problem is somewhere on your side.

PrintDocument doc = new PrintDocument();

doc.PrinterSettings.PrinterName = @"\\192.168.0.2\hp LaserJet 1010 Series Driver";

doc.PrintPage += Doc_PrintPage;

doc.Print();

private void Doc_PrintPage(object sender, PrintPageEventArgs e)

{

e.Graphics.DrawImage(Image.FromFile(@"C:\Temp\test.jpg"), e.MarginBounds.Left, e.MarginBounds.Top);

}

This code just prints an image.

Best regards,