473,626 Members | 3,325 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing printer settings programmaticall y...

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.PrinterSetti ngs.PaperSize)
if (paperSz.PaperN ame.StartWith(" A4"))
pd.DefaultPageS ettings.PaperSi ze = 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 11088
bump

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

Thank you,

Dale Lundgren

<Ex*******@gmai l.com> wrote in message
news:11******** *************@p 10g2000cwp.goog legroups.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.PrinterSetti ngs.PaperSize)
if (paperSz.PaperN ame.StartWith(" A4"))
pd.DefaultPageS ettings.PaperSi ze = 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
4727
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 , setprinter . I did try with PrinterSetting.setHDevMode but it does not work. Its their is a simple way to change printersetting. thanks umesh.
1
4442
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) The app is compiled into an MDE on a network drive from which several users access it in one location I'm an entry-level programmer, so please frame your answers for less experienced =)
0
1612
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 user every time because many reports are printed in sequence. Therefore, I need to manipulate the default printer's persistent settings (as displayed in Control Panel) using C# code. I know how to obtain the name of the default printer, but how...
1
4164
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 dialog. Turning it on causes Windows to save copies of printed docs in the printer queue (marked as 'completed'). In my research I've come across references to WMI. Is that the best way to do change the option?
1
12159
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 know how will this affect a report rendered by a crystal viewer. I have a web page with a crystal viewer rendering the report on the page. I build my application in one of my development machines and deploy it
1
1680
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 for doing this. My code-behind is in C#. A javascript or css solution would be great as well. This will need to be supported in IE6.
1
4302
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 type (according to the list associated with the printer driver itself) and orientation... It would be nice to programmically control the printer, paper settings and orientation all together to avoid the print dialog and the potential for the user to...
0
1862
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 paper size.... This particular paper size is 30386 Video Top is specific to the printer driver itself... Any sample code as to how to both change the printer and paper size as well as oriention so that the user doesn't have to? This particular printer...
0
2272
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 allows users to pick a location that’s different than the one specified in the Port’s settings which I can read off the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Adobe PDF.
0
8266
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8638
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8365
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.