Chris McClenny
asked on
How do I print in Delphi7 without Form Feed after Printer.EndDoc command
How can I prevent Printer.EndDoc from sending a FormFeed at the end of the print job? I am getting a blank page on the tail end of my print Job.
If it is not possible, is there a better way to print? Here is a general reconstruction of the code snippet in question...
ILDocumentImage1.P_Begin_E nd_Doc:=FA LSE;
Printer.Begindoc;
for i:=0 to ILDocumentImage1.TiffPageC ount-1 do
Begin
PrintThisPage:=PDocData(Cu rrentNode. Data)^.ddP ageList[i] .dpSelecte dForPrint;
if PrintThisPage then
Begin
//Send print job to printer
ILDocumentImage1.PrintDOC( 0,0, Printer.PageWidth,Printer. PageHeight );
if i < (ILDocumentImage1.TiffPage Count-1) then Printer.NewPage;
end;
ILDocumentImage1.Next;
end;
Printer.EndDoc;
If it is not possible, is there a better way to print? Here is a general reconstruction of the code snippet in question...
ILDocumentImage1.P_Begin_E
Printer.Begindoc;
for i:=0 to ILDocumentImage1.TiffPageC
Begin
PrintThisPage:=PDocData(Cu
if PrintThisPage then
Begin
//Send print job to printer
ILDocumentImage1.PrintDOC(
if i < (ILDocumentImage1.TiffPage
end;
ILDocumentImage1.Next;
end;
Printer.EndDoc;
ASKER
vb_jonas...
I tried that and now only page 2, 3, and 2 blank pages print out.
Before, it would print out page 1, 2, and 3 plus 1 blank page.
It's as if no matter what I try, Printer.EndDoc sends an extra Form Feed.
I tried that and now only page 2, 3, and 2 blank pages print out.
Before, it would print out page 1, 2, and 3 plus 1 blank page.
It's as if no matter what I try, Printer.EndDoc sends an extra Form Feed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could do like this (add a TheFirstPage boolean)
ILDocumentImage1.P_Begin_E
Printer.Begindoc;
TheFirstPage := True;
for i:=0 to ILDocumentImage1.TiffPageC
Begin
PrintThisPage:=PDocData(Cu
if PrintThisPage then
Begin
//Send print job to printer, a new page before every page but the first
if Not TheFirstPage Then Printer.NewPage;
TheFirstPage := False;
ILDocumentImage1.PrintDOC(
end;
ILDocumentImage1.Next;
end;
Printer.EndDoc;