2

I can't set properties of PosPritnter class. For example PageModeStation, PageModeVerticalPosition, PageModePrintArea etc.

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

Exception details:

    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)
       ....

Any suggestions?

Jonas
  • 121,568
  • 97
  • 310
  • 388
StreamT
  • 315
  • 2
  • 5
  • 18

1 Answers1

0

Assuming the printer supports it, you probably need to: 1 - Enable page mode

posPrinter.PageModePrint(PageModePrintControl.PageMode);

2 - Define the print area.

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

Before attempting to set that property.

Jason Kealey
  • 7,988
  • 11
  • 42
  • 55
  • Can you please check my question here http://stackoverflow.com/questions/12408057/pos-for-net-print-formatting-cant-use-escape-character-char27#comment16677149_12408057 I can't seem to get the Microsoft POSPrinter Simulator to have any sort of formatting (bold, text alignment, etc). Doesn't work on my actual pos printer either. – Chris Klepeis Sep 13 '12 at 15:14