如何向打印机直接发送控制字符(70分)

  • 主题发起人 paulannar
  • 开始时间
P

paulannar

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在做一个票据打印机控制程序,用的是STAR的57mm打印机。想向打印机直接发送控制命令,请问应该如何处理?
最好给个例子
谢谢了!
 
VCL Reference
Printer, Canvas, PageWidth, PageHeight Example
This example uses a button and a memo on a form. When the user clicks the button, the content of the memo is printed, with a 200-pixel border around the page. To run this example successfully, you must add the Printers unit to the uses clause of your unit.
procedure TForm1.Button1Click(Sender: TObject);
begin
with Printerdo
begin
begin
Doc;
Canvas.TextRect(Rect(200,200,PageWidth-200,PageHeight-200),
200, 200, Memo1.Lines.Text);
EndDoc;
end;

end;

 
我说的是打印驱动命令
通过串口发给打印机,而不使用打印机的驱动程序。
 
顶部