473,396 Members | 2,090 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,396 software developers and data experts.

multipage print trouble... T.T

Hello,
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.
But it work's correctly in PrintPreviewDialog.

I don't know the reson.
please, see that source code.
//below contents..

const int DPI = 96;
private int iNumberPages = 0;
private int currentPage = 0;

private void print()
{
PrintDocument prndoc = new PrintDocument();
PrintDialog pdlg = new PrintDialog();
prndoc.PrintPage += new PrintPageEventHandler(OnPrintP*age);
prndoc.QueryPageSettings += new
QueryPageSettingsEventHandler(*OnQueryPageSettings );
pdlg.PrinterSettings = prndoc.PrinterSettings;
if(pdlg.ShowDialog() != DialogResult.OK)
return;
prndoc.PrinterSettings.Printer*Name =
pdlg.PrinterSettings.PrinterNa*me;
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 1440

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

Similar topics

1
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
0
by: Nigel | last post by:
The Visual Basic .NET Step by Step book has the following code and text: Imports System.Drawing.Printing Private Sub PrintText(ByVal sender As Object, ByVal ev As PrintPageEventArgs)...
1
by: szabelin | last post by:
Is it possible to dynamically add a PageView to MultiPage? TabStrip has items property, so Tab and TabSeparator can be added... how about adding PageView to MultiPage? If not possible please...
1
by: Dan | last post by:
IE WebControls Tab/MultiPage state problem I have a IE tab/multipage on a WebForm (aspx) like this: <code> <iewc:TabStrip id="tabs" runat="server" TargetID="MultiPage1"> <iewc:Tab...
1
by: sukanya s via .NET 247 | last post by:
(Type your message here) -------------------------------- From: sukanya s I have controls within a Multipage Web Control. I want to validate the Conrols within the Multipage control using...
2
by: Child | last post by:
I have a page which has a tabbstrip and a multipage. The tab strip works great, and navigates the multipage no problem. However, I have a situation where I would like to have a "hidden"...
0
by: John | last post by:
This is in reference to Internet Explorer WebControls that can be located at the following link: http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/overview/overview.asp ...
1
by: GW | last post by:
Trying to force a new page when required using e.HasMorePages = True but not having much luck. All prints OK except for trying to figure out how to do a page feed without exiting the loop. ...
1
by: Randy Koeller | last post by:
Hello Have looked all over google for this Answer but I can't find it. Ma bey you all can help me? I have a multipage form with 3 tabs. I would like to know if there is anyway to print all 3 tabs...
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: 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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.