Reputation: 147
The following code is used to print two pages. When printed in Simplex-mode, the correct side of the paper is printed on. When printed in Duplex-mode, the paper comes out of the printer in the correct orientation, but the paper has been flipped during printing and the front/rear pages have been printed on the wrong sides of the sheet, even though the stock was loaded correctly in the printer. When printing jobs on special stock, this is a significant concern. This issue has been tested and reproduced on multiple HP duplex printer models. The behavior seems to be an inconsistency on the printer side, but the only fix is to reverse the page print-order in the code.
Is there a better was to address this in code?
private int _pageCnt = 0;
private void PrintTest(string printerName, bool duplex)
{
System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument();
pDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(pDoc_PrintPage);
_pageCnt = 1;
pDoc.PrinterSettings.PrinterName = printerName;
pDoc.PrinterSettings.Duplex = (duplex) ? System.Drawing.Printing.Duplex.Vertical : System.Drawing.Printing.Duplex.Simplex;
pDoc.Print();
}
private void pDoc_PrintPage(Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString(_pageCnt.ToString(), new System.Drawing.Font("Arial", 40), Brushes.Black, new System.Drawing.PointF(50, 50));
_pageCnt += 1;
e.HasMorePages = (_pageCnt <= 2);
}
Upvotes: 0
Views: 1952
Reputation: 26
This is a known problem with some models of both HP and Ricoh printers. When printing in simplex it starts the page on one side of the paper. When printing in duplex, it starts the page on the other side of the input sheets. This is a problem if you use preprinted paper, like letterhead or check stock, and you have both simplex and duplex pages.
There are printer settings in both the Ricoh and HP printers to handle this. Look for it under letterhead paper handling settings.
That being said, we encountered the problem with check stock. We solved it by printing every page as duplex, even if there was nothing on the back of the page. We embedded some HP PCL commands to always give us a second page, even when it was blank.
Upvotes: 1