Advertisement
Guest User

Untitled

a guest
Oct 31st, 2010
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void) randomTest
  2. {
  3.     char printerInitializeCommand [] = {0x1b,'@'};
  4.     char formFeed[] = "\x1B\x0C\x00";
  5.     char printableWidthCommand[] = {0x1b,0x1e,'A',0x00};
  6.     char setRasterPageLengthCommand [] = {0x1b,'*','r','P','0',0x00};
  7.     char startPageCommand [] = {0x00};
  8.     char printDensityCommand [] = {0x1b,0x1e,'d','3' };
  9.     char rasterModeStartCommand [] = {0x1b,'*','r','R',0x1b,'*','r','A'};
  10.     char printSpeedCommand [] = {0x1b,'*','r','Q','0',0x00};
  11.     char docCutTypeCommand [] = {0x1b,'*','r','E','9',0x00};
  12.     char rasterImage [] = {
  13.         //          n1  n2 d1    d2..
  14.         0x1b, 'b', 0x2, 0, 0x00, 0x00, // data
  15.         0x1b, 'b', 0x2, 0, 0x1F, 0xF8,
  16.         0x1b, 'b', 0x2, 0, 0x3F, 0xFC,
  17.         0x1b, 'b', 0x2, 0, 0x77, 0xEE,
  18.         0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
  19.         0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
  20.         0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
  21.         0x1b, 'b', 0x2, 0, 0x0F, 0xF0,
  22.         0x1b, 'b', 0x2, 0, 0x1F, 0xF8,
  23.         0x1b, 'b', 0x2, 0, 0x1F, 0xF8,
  24.         0x1b, 'b', 0x2, 0, 0x3E, 0x7C,
  25.         0x1b, 'b', 0x2, 0, 0x38, 0x1C,
  26.         0x1b, 'b', 0x2, 0, 0x79, 0x9E,
  27.         0x1b, 'b', 0x2, 0, 0x73, 0xCE,
  28.         0x1b, 'b', 0x2, 0, 0x73, 0xCE,
  29.         0x1b, 'b', 0x2, 0, 0xF9, 0x9F,
  30.         0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
  31.         0x1b, 'b', 0x2, 0, 0xFE, 0x7F,
  32.         0x1b, 'b', 0x2, 0, 0xFF, 0xFF,
  33.         0x1b, 'b', 0x2, 0, 0xFF, 0xFF,
  34.         0x1b, 'b', 0x2, 0, 0x00, 0x00,
  35.         0x1b, 'b', 0x2, 0, 0x00, 0x00,
  36.         0x1b, 'b', 0x2, 0, 0x00, 0x00,
  37.         0x1b, 'b', 0x2, 0, 0x00, 0x00};
  38.     char endPageCommand [] = {0x1b,'*','r','Y','1',0x00,0x1b,0x0c};
  39.     char endJobCommand [] = {0x04,0x1b,'*','r','B'};
  40.    
  41.    
  42.     [self sendBytes:printerInitializeCommand ofLength:sizeof(printerInitializeCommand)];
  43.     [self sendBytes:printableWidthCommand ofLength:sizeof(printableWidthCommand)];
  44.     [self sendBytes:printDensityCommand ofLength:sizeof(printDensityCommand)];
  45.     [self sendBytes:rasterModeStartCommand ofLength:sizeof(rasterModeStartCommand)];
  46.     [self sendBytes:printSpeedCommand ofLength:sizeof(printSpeedCommand)];
  47.     [self sendBytes:setRasterPageLengthCommand ofLength:sizeof(setRasterPageLengthCommand)];
  48.     [self sendBytes:docCutTypeCommand ofLength:sizeof(docCutTypeCommand)];
  49.     [self sendBytes:startPageCommand ofLength:sizeof(startPageCommand)];
  50.     [self sendBytes:rasterImage ofLength:sizeof(rasterImage)];
  51.     [self sendBytes:endPageCommand ofLength:sizeof(endPageCommand)];
  52.     [self sendBytes:endJobCommand ofLength:sizeof(endJobCommand)];
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement