Print control characters?

I have a client that uses bitmaps that are loaded into the printers.

To get these printed, I need to send the printer a sequence of control characters.

Like: ESC+'&f1y4x'


How do I do this? If i use a memo, I see this text printed, which I don';t want to.

Comments

  • edited 7:44AM
    Hi!

    What about dotmatrix report with command object containing the command?

    Or here are 2 Delphi components for direct printer access:
    RawPrint
    or
    DXPrint



    If they don't work, try this code, it send command directly to the printer:
    type
      TPassThroughData = record
          nLen: Word;
          Data: array[0..255] of Byte;
      end;
    
    procedure PrintText(s: string);
    var
      PTBlock: TPassThroughData;
    begin
      PTBlock.nLen := Length(s);
      StrPCopy(@PTBlock.Data, s);
      Escape(Printer.Handle, PASSTHROUGH, 0, @PTBlock, nil);
    end;
    
    procedure PrintOut;
    begin
      Printer.BeginDoc;
      PrintText(#27'&l12D' + 'Hello, World!');
      Printer.EndDoc;
    end;
    

Leave a Comment