Solved

how to give the NumberOfCopies to the WinSpool function StartPagePrint function

Posted on 2008-10-23
2
251 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Loop not working 29 48
Help with sorting data in Listbox using VB.NET 3 53
Automated testing suggestions? 2 29
Visual Studio 2013 and Eclipse Neon 6 8
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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now