# Python X2Go (Client) API Documentation (v0.6.1.3)

## x2go.printactions module

Print jobs can either be sent to any of the local print queues (CUPS, Win32API), be opened in an external PDF viewer, be saved to a local folder or be handed over to a custom (print) command. This is defined by four print action classes (`x2go.printactions.X2GoPrintActionDIALOG`, `x2go.printactions.X2GoPrintActionPDFVIEW`, `x2go.printactions.X2GoPrintActionPDFSAVE`, `x2go.printactions.X2GoPrintActionPRINT` and `x2go.printactions.X2GoPrintActionPRINTCMD`).

class `x2go.printactions.``X2GoPrintAction`(client_instance=None, logger=None, loglevel=56)

  Bases: `object`

  `description`

    Return the X2Go print action’s description text.

    Returns: | print action’s description
    Return type: | `str`

  `do_print`(pdf_file, job_title, spool_dir)

    Wrap around the actual print action (`self._do_print`) with gevent.spawn().

    Parameters:

    - pdf_file (`str`) – PDF file name as placed in to the X2Go spool directory
    - job_title (`str`) – human readable print job title
    - spool_dir (`str`) – location of the X2Go client’s spool directory

  `name`

    Return the X2Go print action’s name.

    Returns: | print action name
    Return type: | `str`

class `x2go.printactions.``X2GoPrintActionDIALOG`(client_instance=None, logger=None, loglevel=56)

  Bases: `x2go.printactions.X2GoPrintAction`

  Print action that mediates opening a print dialog window. This class is rather empty, the actual print dialog box must be implemented in our GUI application (with the application’s `x2go.client.X2GoClient` instance.

class `x2go.printactions.``X2GoPrintActionPDFSAVE`(client_instance=None, save_to_folder=None, logger=None, loglevel=56)

  Bases: `x2go.printactions.X2GoPrintAction`

  Print action that saves incoming print jobs to a local folder.

  `save_to_folder` = None

class `x2go.printactions.``X2GoPrintActionPDFVIEW`(client_instance=None, pdfview_cmd=None, logger=None, loglevel=56)

  Bases: `x2go.printactions.X2GoPrintAction`

  Print action that views incoming print job in an external PDF viewer application.

  `pdfview_cmd` = None

class `x2go.printactions.``X2GoPrintActionPRINT`(client_instance=None, printer=None, logger=None, loglevel=56)

  Bases: `x2go.printactions.X2GoPrintAction`

  Print action that actually prints an incoming print job file.

class `x2go.printactions.``X2GoPrintActionPRINTCMD`(client_instance=None, print_cmd=None, logger=None, loglevel=56)

  Bases: `x2go.printactions.X2GoPrintAction`

  Print action that calls an external command for further processing of incoming print jobs.

  The print job’s PDF filename will be prepended as last argument to the print command used in `x2go.printactions.X2GoPrintActionPRINTCMD` instances.