[WinPrnDev] Duplicate Print jobs

  • From: Octavian Rinciog <octavian.rinciog@xxxxxxxxx>
  • To: winprndev@xxxxxxxxxxxxx
  • Date: Tue, 1 Oct 2013 13:28:11 +0300

I'm trying to duplicate print jobs (it means when someone prints a
document, this document is printed automatically also on another
printer). The purpose is that I want to transform all printed
documents into pdf and send them to a server.

I was able to retrieve all print jobs using
`FindFirstPrinterChangeNotification` and I was able to retrieve job
content using `ReadPrinter`.

The job is in EMF form.

But when I want to write this job to another printer, using
`WritePrinter`, the job seems to get to the printer, in the status
window of the new printer is written `Printed`, but it doesn't happen
anything. The job doesn't arrive to the printer.

The code that duplicates the job is:


    do{
        if (!ReadPrinter(hPrinterJob, lpBytes, BUFSIZE, &dwBytesRead))
        {
            return FALSE;
        }

        else
        {
            if (!WritePrinter(hPrinterNew, lpBytes, dwBytesRead,
&dwBytesWritten))
            {
                return FALSE;
            }
        }
    }while(dwBytesRead!=0);

Does anyone know what it's wrong and how to fix?

An example of software that does something like this is:  [link][1]


Thank you

P.S I know this is not a printer driver problem, but maybe you have an
idea how to fix this.

  [1]: http://www.colorpilot.com/emfprinterpilot.html

-- 
Octavian Rinciog
---
Questions? First check the UndocPrint pages at 
http://www.undocprint.org/winspool

To unsubscribe, visit the List Server page at 
//www.freelists.org/list/winprndev

Other related posts: