Página 1 de 1


Publicado: Lun Feb 25, 2019 8:25 am
por Timm

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


Re: Printjobs

Publicado: Lun Feb 25, 2019 8:18 pm
por ignacio

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.


Re: Printjobs

Publicado: Mar Feb 26, 2019 9:45 am
por Timm
Hi Ignacio,

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

Código: Seleccionar todo

#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