468,248 Members | 1,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,248 developers. It's quick & easy.

Change Print Setting

Hi,

I tried to change the print setting by

PrintDialog dlg = new PrintDialog();
dlg.AllowSomePages = true;
dlg.AllowSelection = true;
dlg.Document = pd;
dlg.PrinterSettings.MinimumPage = 1;
dlg.PrinterSettings.MaximumPage = 1;
pd.PrinterSettings.FromPage = 1;
pd.PrinterSettings.ToPage = 1;
pd.DocumentName = "test";
pd.Print();

while pd is a document with 3 pages.

The result is always 3 pages printed.
I think I did not change the print setting actually.
What's wrong?

More if I want to print to file, how I can specify the
file name to print?

Thanks a lot.
Nov 15 '05 #1
1 2342
From what I remember all your doing is setting some variables. Your printing
code tells the printing system to stop printing by setting
PrintPageEventArgs.HasMorePages to false via your PrintDocument.PrintPage
supplied delegate. So you need to check what page your on and set
HasMorePages accordingly given the "from" and "to" settings.

Regards
Lee

"Rainbow" <ra*****@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
Hi,

I tried to change the print setting by

PrintDialog dlg = new PrintDialog();
dlg.AllowSomePages = true;
dlg.AllowSelection = true;
dlg.Document = pd;
dlg.PrinterSettings.MinimumPage = 1;
dlg.PrinterSettings.MaximumPage = 1;
pd.PrinterSettings.FromPage = 1;
pd.PrinterSettings.ToPage = 1;
pd.DocumentName = "test";
pd.Print();

while pd is a document with 3 pages.

The result is always 3 pages printed.
I think I did not change the print setting actually.
What's wrong?

More if I want to print to file, how I can specify the
file name to print?

Thanks a lot.

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Csaba2000 | last post: by
2 posts views Thread by Samuel Yin | last post: by
2 posts views Thread by Brad Pears | last post: by
4 posts views Thread by Joe Kovac | last post: by
3 posts views Thread by Alan J. Salmoni | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.