473,379 Members | 1,326 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,379 software developers and data experts.

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 11043
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Umesh | last post by:
Hi all I am trying to change the printer(like paper source ,etc) setting in C#. But i am unable to do it. I am not sure how to do it. should i have to use WIN API like Openprinter , getprinter ,...
1
by: akhosravi4703 | last post by:
I'm having a problem with an application I pushed out recently. First, some background The application was made with Access 97 (unfortunately I'm stuck with this older version for the moment)...
0
by: Paul E Collins | last post by:
I am using the IE browser control to print HTML reports from a C# application. I do not know of any way to pass print settings to the control (such as landscape orientation), and cannot prompt the...
1
by: slk23 | last post by:
Hi, I'd like to programmatically change the "Keep Printed Documents" option for a printer. The option is available in the Windows UI by going to the Advanced tab on the printer's Properties...
1
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to...
1
by: Kenny | last post by:
Hello, I currently have an ASP.NET application that is displaying various reports. Some of the reports need to be printed in Portrait orientation and others in Landscape. Does anyone know a method...
1
by: Anthony Nystrom | last post by:
I need to within code control some printer settings before raising the print dialog... I need to set some properties for the printer such as "The Printer to Print too", Page settings such as paper...
0
by: Anthony Nystrom | last post by:
I am having trouble with changing printer settings before I raise either the pagesetup dialog or the print preview dialog... Changing the printer name is easy, but I am also trying to change the...
0
by: Mike | last post by:
Hi! I am programmatically converting Excel to PDF using Adobe PDF printer installed with Adobe Acrobat 6 and above. When I initiate Print command for this printer, a window comes up which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.