我創建了一個ActiveX控件,其中包含處理打印機(Star TSP100)的所有方法,如實例化,打印機等。ActiveX正在註冊com。 當我通過javascript使用打印機方法時,除PrintBarCode和PrintBitmap方法外,所有方法都正常工作,並引發錯誤。PosPrinter.PrintBarCode,PosPrinter.PrintBitmap在PrintNormal工作時不工作
位圖我用: -
printer.PrintBitmap(PrinterStation.Receipt, path, percentWidth * lineWidth/100, PosPrinter.PrinterBitmapCenter);
和條碼: -
printer.PrintBarCode(PrinterStation.Receipt, code, BarCodeSymbology.Code93, 80, (int)(0.9 * lineWidth), PosPrinter.PrinterBarCodeCenter, BarCodeTextPosition.Below);
雖然這兩種方法也在從Visual Studio調試模式下工作。但是在系統中創建安裝並安裝後,這兩者不起作用。
的錯誤是: -
Microsoft.PointOfService.PosControlException: Method PrintBarCode threw an exception. Attempt was made to perform an illegal or unsupported operation with the device, or an invalid parameter value was used.
at Microsoft.PointOfService.Legacy.LegacyProxy.ThrowLegacyMethodException(String methodName, Int32 ResultCode, Exception e)
at Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethod(String methodName, Object[]& parameters, Boolean[] byRef)
at Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethodAndCheckImpl(String methodName, Object[]& parameters, Boolean[] byRef)
at Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethodAndCheckImpl(String methodName, Object[] parameters)
at Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethodAndCheck(String methodName, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6, Object param7)
at Microsoft.PointOfService.Legacy.LegacyPosPrinter.PrintBarCode(PrinterStation station, String data, BarCodeSymbology symbology, Int32 height, Int32 width, Int32 alignment, BarCodeTextPosition textPosition)
at xyx.testclass.PrintBarCode(String code)
ErrorCode: Illegal
ErrorCodeExtended: 0