473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Multiple Printing trouble... T.T

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;
}

Nov 17 '05 #1
0 849

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jody Gelowitz | last post by:
I was just wondering if anybody has been able to figure out how to get Safe Printing working over an Internet Zone. Based on what was mentioned from the previous thread titled "Safe Printing",...
2
by: Sigurd Bruteig | last post by:
Hi all! I have a problem printing multiple reports. The code i use is: Dim stDocName As String stDocName = "rptInvoice" DoCmd.OpenReport stDocName, acNormal, , " = date()" The problem is that...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
2
by: cFleury | last post by:
Hello, I am new to ASP.NET and I have to print an invoice from an application written in ASP.NET, I have followed most of the threads in this newsgroup about the dificulties posed by the server...
6
by: Bill | last post by:
Hi I am trying to get my listbox items to print if they stream past the one page mark. my code is working for one page of information (if the e.hasmorepages) is not there. But I am having...
0
by: Phil Galey | last post by:
I'm printing to a DeskJet 5550 printer. From WordPerfect, if I have a color document and I specify grayscale in the printer properties dialog, it prints in grayscale as expected. However, from...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: Scott David Daniels | last post by:
Here are some tweaks on both bits of code: Paul McGuire wrote: .... m = for b in bases: if hasattr(b, '__mro__'): if MetaHocObject.ho in b.__mro__: m.append(b) if m:
0
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.