#1 2022-10-17 22:12:21

skamradt
Member
Registered: 2022-09-15
Posts: 3

Duplex printing issue?

I have noticed that when duplex printing (printing on both sides of the paper) directly from the .ShowPreviewForm it will not clear the second page before printing on it.  The text from the first page will appear duplicated on the second page if the text for the second page does not fully cover the second page. I tried this on two separate printers (Brother 2395 laser printer & Epson 8550 ink jet) and both behave identically.  Exporting to PDF and then printing duplex does not show the problem so I believe it has something to do with the internal print logic.

Offline

#2 2022-10-18 08:55:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,504
Website

Re: Duplex printing issue?

TGDIPages.PrintPages calls the regular NewPage which makes no difference between duplex or simplex printing, AFAIK.

Offline

#3 2022-10-19 10:02:08

rvk
Member
Registered: 2022-04-14
Posts: 47

Re: Duplex printing issue?

Works fine for me.

Does this also happen with TGDIPages.PrintPages()?
How do you set the duplex? Manually through the dialog or in code?

Some simple example code which reproduces this?
Something like this (which works for me):

procedure TForm1.Button1Click(Sender: TObject);
var
  PDF: mORMotReport.TGDIPages;
begin
  PDF := mORMotReport.TGDIPages.Create(Self);
  try
    PDF.BeginDoc;
    PDF.DrawTextAt('Test page 1', 10);
    PDF.NewPage;
    PDF.DrawTextAt('Test page 2', 20);
    PDF.EndDoc;
    PDF.ShowPreviewForm; // setting printer to duplex and printing works correctly
  finally
      PDF.Free;
  end;
end;

BTW, when printing though Adobe Reader, the chances are that the entire page is filled with whitespace and send to the printer, and thus overlapping your previous text. So this could still be a driver fault. You could test this by creating a small example with printdialog (to set the duplex option) which directly prints two pages to the printer.

Offline

Board footer

Powered by FluxBB