[WinPrnDev] Re: Duplicate Print jobs

  • From: Alex Egorov <alex@xxxxxxxxxxxxxx>
  • To: winprndev <winprndev@xxxxxxxxxxxxx>
  • Date: Tue, 1 Oct 2013 15:12:41 +0400

First of all - your source print job should be paused,
Try your code on the printer with the pause state.
Possible situation - that source print jobs already
was sent to printer from queue and you try it to read.

Converting to pdf this is additional big job


On Tue, Oct 1, 2013 at 2:28 PM, Octavian Rinciog <octavian.rinciog@xxxxxxxxx
> wrote:

> 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
>



-- 
Alex Egorov
http://usefulsoft.com

Other related posts: