POS For .NET:无法设置PosPrinter的属性属性

时间:2010-02-01 19:41:48

标签: .net point-of-sale opos

我无法设置PosPritnter类的属性。例如PageModeStation,PageModeVerticalPosition,PageModePrintArea等。

PosPrinter posPrinter = (PosPrinter)posExplorer.CreateInstance(posPrinterInfo);
posPrinter.Open();
posPrinter.Claim(1000);
posPrinter.DeviceEnabled = true;
posPrinter.PageModeVerticalPosition = 10; //<--- Exception thrown: Failed to set property PageModeVerticalPosition

异常详情:

    Microsoft.PointOfService.PosControlException was unhandled
    Message="Failed to set property PageModeVerticalPosition."
    Source="Microsoft.PointOfService"
    ErrorCodeExtended=0
    StackTrace:
           at Microsoft.PointOfService.Legacy.LegacyProxy.SetProperty(String propertyName, Object propertyValue)
           at Microsoft.PointOfService.Legacy.LegacyPosPrinter.set_PageModeVerticalPosition(Int32 value)
       ....

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

假设打印机支持它,您可能需要: 1 - 启用页面模式

posPrinter.PageModePrint(PageModePrintControl.PageMode);

2 - 定义打印区域。

posPrinter.PageModePrintArea = new Rectangle(0, 0, posPrinter.PageModeArea.X, posPrinter.PageModeArea.Y);

在尝试设置该属性之前。