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

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 pctPrintDocument As System.Drawing.Printing.PrintDocument

Friend WithEvents pctPrintDialog As System.Windows.Forms.PrintDialog

.......
If optDuplexDouble.Checked Then
pctPrintDialog.Document = Me.pctPrintDocument
pctPrintDocument.PrinterSettings.Duplex = Duplex.Vertical
pctPrintDocument.DefaultPageSettings.PrinterSettin gs.Duplex =
Duplex.Vertical
pctPrintDialog.PrinterSettings.Duplex = Duplex.Vertical
Else
Me.pctPrintDocument.PrinterSettings.Duplex = Duplex.Simplex
End If
.......
Aug 26 '05 #1
0 3218

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

Similar topics

10
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...
1
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...
0
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...
0
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...
0
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...
0
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...
1
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...
0
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...
10
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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.