Gunakan fungsi page break di fast-report atau gunakan Character khusus untuk mengirim command ke printer seperti #12 untuk page break
Contoh Untuk Delphi memakai di bawah ini untuk Cetak Draft
procedure PrintMe(Content: TStringList);
var
sPrinter, sDriver, sPort, sTitle: array[0..255] of Char;
hPrinter, hDevMode: THandle;
DocInfo1: TDocInfo1;
W: DWORD;
S: String;
C: Char;
I: Integer;
begin
// page-break
C := #12;
// initialize the document structure
with DocInfo1 do begin
pDocName := StrPCopy(sTitle, 'Your Title Here');
pOutputFile := nil;
pDatatype := 'RAW';
end;
// get the current printer (sPrinter)
Printer.GetPrinter(sPrinter, sDriver, sPort, hDevMode);
// open the printer
OpenPrinter(sPrinter, hPrinter, nil);
try
try
// start document to spooler
StartDocPrinter(hPrinter, 1, @DocInfo1);
StartPagePrinter(hPrinter);
// send the 'Source' to the printer
for I := 0 to Source.Count - 1 do begin
S := Source.Strings;
if not WritePrinter(hPrinter, PChar(S), Length(S), W) then
Break;
end;
// send a page-break to the printer (optional)
if not WritePrinter(hPrinter, @C, 1, W) then
Break;
// end the page
EndPagePrinter(hPrinter);
// end the document
EndDocPrinter(hPrinter);
finally
// close the printer
ClosePrinter(hPrinter);
end;
except
// abort the job
AbortPrinter(hPrinter);
raise;
end;
end;
https://www.tek-tips.com/threads/printing-text-on-dotmatrix-printer.921897/
Tidak ada komentar :
Posting Komentar