Delphi 인쇄

702 단어
procedure TForm1.PrinterSetupExecute(Sender: TObject);
begin
PrinterSetupDialog1.Execute;
end;

procedure TForm1.PrintExecute(Sender: TObject);
begin //
if PrintDialog1.Execute=True then
RichEdit1.Print(Form1.Caption);
end;

or

if printdialog1.execute then
PrintStrings(RichEdit1.Lines);


uses ComCtrls;
procedure PrintTXT(const txtFileName:string);
var t:TRichEdit;
begin
try
t := TRichEdit.Create(nil);
t.Lines.LoadFromFile(txtFileName);
t.Print(t.text);
finally
FreeAndNil(t);
end;
end;

PrintTXT('D:\abc\123.txt');

좋은 웹페이지 즐겨찾기