Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Printing to 2 printers at same time problem.

edited January 2004 in General
I have implemented the code found in an example posted in this newsgroup.
Everything works great, except for one printer. We have 4 HP 2200d's that
are all configured the same. The problem is that one of them always kicks a
blank page at the end when I use the multiple printer code. If I just print
to the same printer all by itself without using the multiple print code,
then it doesn't kick the extra page. Here is the code I am using. Anyone
ever seen this behavior.


if PrintTwoCopies then
begin
FirstPrinterDevice := TppPrinterDevice.Create(Self);
FirstPrinterDevice.Printer.PrinterName :=
PrinterToReportBuilder(Ini.ReportPrinter);
FirstPrinterDevice.Publisher :=
frmPickTicketRpt.repPickTicket.Publisher;

SecondPrinterDevice := TppPrinterDevice.Create(Self);
SecondPrinterDevice.Printer.PrinterName :=
PrinterToReportBuilder(Ini.BackupPrinter);
SecondPrinterDevice.Publisher :=
frmPickTicketRpt.repPickTicket.Publisher;

try
FirstPrinterDevice.StartJob;
SecondPrinterDevice.StartJob;
frmPickTicketRpt.repPickTicket.PrintToDevices;
finally
FirstPrinterDevice.EndJob;
SecondPrinterDevice.EndJob;
FirstPrinterDevice.Free;
SecondPrinterDevice.Free;
end;
end
else
begin
frmPickTicketRpt.repPickTicket.PrinterSetup.PrinterName :=
PrinterToReportBuilder (Ini.ReportPrinter);
frmPickTicketRpt.repPickTicket.Print;
end;

Thanks in advance,

Rick Whitaker
Iowa Glass Depot

Comments

  • edited January 2004
    Also, needed to add that I look at the spool files and they are 2 different
    sizes, even though they are both using the same printer drivers... Odd.


  • edited January 2004
    Hi Rick,

    The code you have seems to be ok, and I have never seen this behavior
    before. As an alternative, take a look at demo 122 (dm0122.pas) located in
    the RBuilder\Demos\1. Reports\... directory. This is a slightly different
    approach to take to print to multiple printers at once, but is proven to
    work so it may be worth a try.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    Thanks for the response. I found it to be somewhat of a driver setting
    issue. Some printers were setup to use Soft Fonts and others to use
    hardware fonts. The Use Device Setting seemed to work great and the Soft
    Font printed the extra blank page. I changed them all to Device Setting and
    all is well.

    Thanks

    Rick Whitaker
    Iowa Glass Depot

This discussion has been closed.