Solved

how to give the NumberOfCopies to the WinSpool function StartPagePrint function

Posted on 2008-10-23
2
292 Views
Last Modified: 2008-10-28
Question:
I use the class RawPrinterHelper from microsoft support(see http://support.microsoft.com/kb/322091). I added one more parameter "Copies" to function:
Public Shared Function SendFileToPrinter(ByVal szPrinterName As String, ByVal szFileName As String, ByVal Copies As Integer) As Boolean, changed:bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, fs.Length) to :
Dim i As Integer
For i = 1 To Copies
    bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, fs.Length)
Next

But if the copies is big number(999), print spool service gets errors. I know it is not a good way to tell the printer how many copies to print by sending multiple times for the same data. I wonder if we can set the copies in StartPagePrint or what is the best to tell the functions the number of copies.
0
Comment
Question by:smurri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Expert Comment

by:SameerJagdale
ID: 22785876
0
 

Accepted Solution

by:
smurri earned 0 total points
ID: 22786174
The proposed way does not work for us.

We will use the printer commands for the printer and connect directly.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question