470,821 Members | 2,081 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Changing printer settings programmatically...

Is there a way to change the DEFAULT printer settings for an installed
printer? I want it to change the printer settings for a specified
printer at the whole OS/Windows level, not just for the application.
Specifically, I need to change the default papersize for the printer
for about 150 remote users.

I've tried changing the paper size for the printer using the
PrintDocument class, but that doesn't seem to change the default paper
size at the OS/Windows level. It appears to only change it for that
specific process/application.

Here is the code I used:

PrintDocument pd = new PrintDocument();

foreach (PaperSize paperSz in pd.PrinterSettings.PaperSize)
if (paperSz.PaperName.StartWith("A4"))
pd.DefaultPageSettings.PaperSize = paperSz;

I've verified that is actually changes the page size for the printer
for the current process, but when I look at Printing Preferences for
the printer at the OS level, it set to a different page size. Is there
a way to change this property using C#/VB.Net?

Thanks,
ExitusLSU

Mar 8 '06 #1
2 10667
bump

Mar 13 '06 #2
Did you ever resolve this issue? I also have the same need.

Thank you,

Dale Lundgren

<Ex*******@gmail.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Is there a way to change the DEFAULT printer settings for an installed
printer? I want it to change the printer settings for a specified
printer at the whole OS/Windows level, not just for the application.
Specifically, I need to change the default papersize for the printer
for about 150 remote users.

I've tried changing the paper size for the printer using the
PrintDocument class, but that doesn't seem to change the default paper
size at the OS/Windows level. It appears to only change it for that
specific process/application.

Here is the code I used:

PrintDocument pd = new PrintDocument();

foreach (PaperSize paperSz in pd.PrinterSettings.PaperSize)
if (paperSz.PaperName.StartWith("A4"))
pd.DefaultPageSettings.PaperSize = paperSz;

I've verified that is actually changes the page size for the printer
for the current process, but when I look at Printing Preferences for
the printer at the OS level, it set to a different page size. Is there
a way to change this property using C#/VB.Net?

Thanks,
ExitusLSU

Apr 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Umesh | last post: by
1 post views Thread by akhosravi4703 | last post: by
reply views Thread by Paul E Collins | last post: by
1 post views Thread by Karthic | last post: by
1 post views Thread by Kenny | last post: by
1 post views Thread by Anthony Nystrom | last post: by
reply views Thread by Anthony Nystrom | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.