我无法设置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)
....
有什么建议吗?
答案 0 :(得分:0)
假设打印机支持它,您可能需要: 1 - 启用页面模式
posPrinter.PageModePrint(PageModePrintControl.PageMode);
2 - 定义打印区域。
posPrinter.PageModePrintArea = new Rectangle(0, 0, posPrinter.PageModeArea.X, posPrinter.PageModeArea.Y);
在尝试设置该属性之前。