I am going to print paper of 15 X 4 Inch.
It's a continuous form.
But When I Print Multiple Paper, Printer does'nt print back to back.
If I am goint to print 3 pages.
Jump over 3~4(paper)Pages with empty after print 1page.
And print second page on fifth paper.
I don't know the reson.
please, see that source code.
//below contents..
private void print()
{
PrintDocument prndoc = new PrintDocument();
PrintDialog pdlg = new PrintDialog();
prndoc.PrintPage += new PrintPageEventHandler(OnPrintPage);
prndoc.QueryPageSettings += new
QueryPageSettingsEventHandler(OnQueryPageSettings) ;
pdlg.PrinterSettings = prndoc.PrinterSettings;
if(pdlg.ShowDialog() != DialogResult.OK)
return;
prndoc.PrinterSettings.PrinterName = pdlg.PrinterSettings.PrinterName;
currentPage = 0; //member Variable
iNumberPages = 3; //All of Page Number... member variable
prndoc.Print();
}
private void OnQueryPageSettings(Object obj, QueryPageSettingsEventArgs
qpsea)
{
int pagewidth = 380, pageheight=89; //millimeter
float pwf = 0f, phf = 0f;
pwf = pagewidth /25.4F;
phf = pagewidth /25.4F;
// DPI was member variable.. 96 because my monitor is 96 DPI
pwf *= DPI;
phf *= DPI;
qpsea.PageSettings.PaperSize = new PaperSize("Giro", (int)pwf,
(int)phf);
qpsea.PageSettings.Margins = new Margins(0, 0, 0, 0);
}
private void OnPrintPage(Object obj, PrintPageEventArgs ev)
{
Graphics g = ev.Graphics;
g.PageUnit = GraphicsUnit.Millimeter;
// contents to print...
currentPage++;
ev.HasMorePages = currentPage < iNumberPages;
}