In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Printjobs

Xailer professional forum in English
Timm
Posts: 93
Joined: Mon Jun 21, 2010 11:01 am

Printjobs

Postby Timm » Mon Feb 25, 2019 8:25 am

Hi!

How can I get information about the print jobs that are currently being printed?
Which printers are currently active, the current page number and total pages.

Best regards

Timm
User avatar
ignacio
Site Admin
Posts: 8558
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

Re: Printjobs

Postby ignacio » Mon Feb 25, 2019 8:18 pm

Hi,

I'm afraid that information is not given by Xailer. I guess, that information maybe given by the printer spooler which has its own API. I'm sorry I can not offer you better help.

Regard,s
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Timm
Posts: 93
Joined: Mon Jun 21, 2010 11:01 am

Re: Printjobs

Postby Timm » Tue Feb 26, 2019 9:45 am

Hi Ignacio,

I found this code in the google group comp.lang.xharbour:

Code: Select all

#include "cstruct.ch"
#include "hbdll.ch"

IMPORT OpenPrinter( par1, par2, par3 ) FROM winspool.drv
IMPORT StartDocPrinter( par1, par2, par3 ) FROM winspool.drv
IMPORT WritePrinter( par1, par2, par3, par4 ) FROM winspool.drv
IMPORT EndDocPrinter( par1 ) FROM winspool.drv
IMPORT ClosePrinter( par1 ) FROM winspool.drv
IMPORT GetJob( par1, par2, par3, par4, par5, par6 ) FROM winspool.drv

   C structure DOC_INFO_1 align 4
      member pDocName    is CTYPE_CHAR_PTR
      member pOutputFile is CTYPE_CHAR_PTR
      member pDataType   is CTYPE_CHAR_PTR
   end C structure

   C structure JOB_INFO_1
      member JobId        is CTYPE_UNSIGNED_LONG
      member pPrinterName is CTYPE_CHAR_PTR
      member pMachineName is CTYPE_CHAR_PTR
      member pUserName    is CTYPE_CHAR_PTR
      member pDocument    is CTYPE_CHAR_PTR
      member pDatatype    is CTYPE_CHAR_PTR
      member pStatus      is CTYPE_CHAR_PTR
      member Status       is CTYPE_UNSIGNED_LONG
      member Priority     is CTYPE_UNSIGNED_LONG
      member Position     is CTYPE_UNSIGNED_LONG
      member TotalPages   is CTYPE_UNSIGNED_LONG
      member PagesPrinted is CTYPE_UNSIGNED_LONG
      member Submitted    is CTYPE_VOID_PTR
   end C structure

Unfortunately this only works with xHarbour.
Do you have a hint for me, how I can port the code to Harbour?

Best regards

Timm

Return to “English”