Error while trying to load trays

Error while trying to load trays

Forum member · Sep 17, 2010
Hi, We have been trying to connect to network printers and it seems to work successfully only on some of our printers. When the printer is installed through the printer wizard, we had no problem at all. However when our application is moved to a server running on Windows Server 2003 some of the network printers could not be accessed anymore. The message we keep getting is the following: System.Runtime.InteropServices.SEHException: External component has thrown an exception. at a(UInt32 ) at ceTe.DynamicPDF.Printing.PaperSizeList..ctor(t ) at zz25.t..ctor(String , Char* ) at zz25.b.a(String ) at ceTe.DynamicPDF.Printing.Printer..ctor(String printerName) at Imprimantes.LoadTrayList() at Imprimantes.GridViewPrinters_SelectedIndexChanged(Object sender, EventArgs e) at System.Web.UI.WebControls.GridView.OnSelectedIndexChanged(EventArgs e) at System.Web.UI.WebControls.GridView.HandleSelect(Int32 rowIndex) at System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) at System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) This seem to be happening when I am trying to load a printer's trays, the code I use is the following: Printer printer = new Printer(printerName); PaperSourceList trayList = printer.PaperSources; DropDownListTrays.Items.Clear(); foreach (ceTe.DynamicPDF.Printing.PaperSource ps in trayList) { DropDownListTrays.Items.Add(ps.Name); } Is there anything we are doing wrong here? The printers that are throwing an exception are the following ones: HP LaserJet 4050 Series PCL6 HP LaserJet P4010/P4510 Series PCL6

Re: Error while trying to load trays

Forum member · Sep 20, 2010
Hello, We just ran some tests using the latest version of the PrintManager, but it still gives the same result. Do you have further suggestions to offer? Kind Regards

Re: Error while trying to load trays

Support · Sep 20, 2010
Hello, Are you able to go to the Printing Preferences and view the Paper Sources? Is the identity impersonate set to true in the web.config of your web application? (<identity impersonate="true"/>) Thanks, ceTe Software Support Team.

Re: Error while trying to load trays

Forum member · Sep 20, 2010
Hi, The printers are shared on the same domain as the application server and can be accessed without any problem (only 2 out of 5 printers actually fail). Regarding your second question, we are not using identity impersonation on our asp application. Is there any other information you need? Kind Regards

Re: Error while trying to load trays

Support · Sep 20, 2010
Hello, Can you please turn on the impersonation and see if those two printers work. If you don't want to turn on the impersonation on your application, please use the following code to build a test app. protected void Page_Load(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); foreach (string s in PrinterSettings.InstalledPrinters) { Printer printer = new Printer(s); PaperSourceList trayList = printer.PaperSources; foreach (ceTe.DynamicPDF.Printing.PaperSource ps in trayList) { sb.AppendLine(ps.Name); } } Response.Write(sb); } Thanks, ceTe Software Support Team

Re: Error while trying to load trays

Forum member · Sep 21, 2010
Hello, We managed to track down the problem and solve it. Actually, the exception was caused by printers using the wrong drivers (which did not prevent them from printing when used manually though). Installation of the correct drivers on the printer server solved the problem. Thank you for your help. Kind Regards