Try the sample code below here, u can also adding the printer control code
in the string.
procedure TForm1.Button1Click(Sender: TObject);
var
F:TEXTFILE;
begin
ASSIGNFILE(F,'LPT1');
REWRITE(F);
WRITELN(F,'TEST1 FIRST LINE');
WRITELN(F,'TEST2 SECOND LINE');
CLOSEFILE(F);
end;
end.
For the common priter Epson LQ-1600k, chr(12) is move to next page,
chr(27)+'@' is initial the printer and clear the printer buffers.
procedure TForm1.Button1Click(Sender: TObject);
var
F:TEXTFILE;
begin
ASSIGNFILE(F,'LPT1');
REWRITE(F);
WRITELN(F,chr(27)+'@');
//initial the printer
WRITELN(F,'TEST1 FIRST LINE');
WRITELN(F,chr(12));
// move the paper to a new page
CLOSEFILE(F);
end;