473,749 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Print duplex on network printer



In my application I need to give the user the ability to print duplex if the
selected printer supports duplex printing. Many of the printer options do
not make much sense in my application, and many of the settings in the common
printer dialog would have a negative impact on my printing process. To
handle this strict printing constraint on which my application imposes I do
not want to show the common print dialog. I want to be able to change the
settings from within code. I have run across one problem using the duplex
property off the PrinterSettings object. On this page,
http://msdn.microsoft.com/library/de...classtopic.asp,
it states that the duplex property specifies the printer’s duplex setting.
This seems to only work if the printer is installed as a local printer. I am
not sure if this is related or not, but I found this article stating a
problem in printing duplex on a network printer for Word automation.
http://support.microsoft.com/kb/q230743/. I installed my network printer as
a local printer as the article stated for testing purposes. The code I
provided below did in fact print duplex. I don’t wish to have to say that my
application only supports local printers. If a network printer is used and I
show the print dialog and I navigate to the printer properties dialog and
change the duplex setting to duplex, the application does indeed print duplex
as well. I can understand if the user printing on a network printer doesn’t
have access to print duplex and the print command throws some type of access
denied error. Which if I try to open the printer using API’s I do get an
access denied error if I use the level of access required to set the duplex
property. What confuses me is if I show the print dialog, the changing of
the duplex property works. Is there a way to reproduce that same behavior
from within code? Also is there a way to detect whether or not the setting
of the duplex property worked from within code as well?

Friend WithEvents pctPrintDocumen t As System.Drawing. Printing.PrintD ocument

Friend WithEvents pctPrintDialog As System.Windows. Forms.PrintDial og

.......
If optDuplexDouble .Checked Then
pctPrintDialog. Document = Me.pctPrintDocu ment
pctPrintDocumen t.PrinterSettin gs.Duplex = Duplex.Vertical
pctPrintDocumen t.DefaultPageSe ttings.PrinterS ettings.Duplex =
Duplex.Vertical
pctPrintDialog. PrinterSettings .Duplex = Duplex.Vertical
Else
Me.pctPrintDocu ment.PrinterSet tings.Duplex = Duplex.Simplex
End If
.......
Aug 26 '05 #1
0 3279

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

Similar topics

10
16310
by: Joe M | last post by:
I was wondering if someone could lend me a hand with a C# problem I am having I am trying to use the “setPrinter” api to change the duplex setting (under printing preferences on printer context menu) so that I can send a document to the printer in duplex mode These are my declarations string pDeviceNameg, IntPtr pDevModeOutput, ref IntPtr pDevModeInput, int fMode) string szPrinter,
1
1926
by: Maileen | last post by:
Hi, We have a little problem in 1 of our ASP page :( on this page, we can add new printers (local or network) and to print a report on a selected (by default) printer. We we do the test on a local printer, it works perfectly. Unfotunately, when we try to print the same report on one of our network printers, it fails.
0
3254
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using PrintDocument.Print() (.NET framework v 1.1) I can print to a local printer plugged into LPT1 on the web server, but not to a network printer. The same printing code to a network printer works in a .NET web app when
0
560
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and many of the settings in the common printer dialog would have a negative impact on my printing process. To handle this strict printing constraint on which my application imposes I do not want to show the common print dialog. I want to be able to...
0
1070
by: louiann | last post by:
Hi All! I want to start out by saying that everyone from the beginner to the MVP have all contributed information, thoughts and comments that makes this group invaluable to us who are looking for solutions to our current problems, or as my company puts it "opportunities." Here is my current opportinuty: I have been charged with the task of intercepting print jobs, comparing
0
2977
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the report directly to the printer bypassing the Crystal report viewer altogether. When sending the job directly to the printer I use the PrintToPrinter command CR.PrintToPrinter(1, False, 0, 0)
1
2192
by: dotnetdummy | last post by:
Hi, Can anyone who can help me out if possible. At the moment, I'm working on a window application (vb.net) which print out html document's through a default network printer. I'm using browser control Dim IE As SHDocVw.InternetExplorer) ....
0
1863
by: jigsmshah | last post by:
i am working on a project (windows service using VB.Net and C#) which gets the check details and check images from the database and prints the check to a printer. Printer name is configured in a XML file. Printer names are names which are available to the system on which the service is running. Printers used are network printers and are added using Printers and Faxes -> Add a printer. To validate the printer I am using the following...
10
8838
by: S_K | last post by:
Hi, I have a directory full of a number of .PDF files that I need to print. Is there any simple way to do this? Using PdfReader purhaps? Thanks in advance. Steve
0
8832
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
9566
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
9388
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...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
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
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.