Skip to content

Instantly share code, notes, and snippets.

@sagmor
Created April 12, 2012 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagmor/2371615 to your computer and use it in GitHub Desktop.
Save sagmor/2371615 to your computer and use it in GitHub Desktop.
Zebra Print Test
// This one gets locked
+ (void)print1WithAddress:(NSString *)printerAddress andPort:(NSInteger)printerPort
{
NSError *error = nil;
TcpPrinterConnection *connection = [[TcpPrinterConnection alloc] initWithAddress:printerAddress andWithPort:printerPort];
[connection open];
NSString *file =
@"! 0 200 200 240 1\r\n"
@"LABEL\r\n"
@"CONTRAST 0\r\n"
@"TONE 0\r\n"
@"SPEED 5\r\n"
@"PAGE-WIDTH 380\r\n"
@"BAR-SENSE\r\n"
@"COUNTRY USA\r\n"
@";// PAGE 0000000003800240\r\n"
@"T SWI10PT.CPF 0 116 40 New Font Test Label\r\n"
@"FORM\r\n"
@"PRINT\r\n";
[connection write:[file dataUsingEncoding:NSUTF8StringEncoding] error:&error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment