# gnome-print-job

## Name

gnome-print-job --

## Synopsis

    struct      GnomePrintJob;
    GnomePrintJob* gnome_print_job_new          (GnomePrintConfig *config);
    GnomePrintConfig* gnome_print_job_get_config
                                                (GnomePrintJob *job);
    GnomePrintContext* gnome_print_job_get_context
                                                (GnomePrintJob *job);
    gint        gnome_print_job_close           (GnomePrintJob *job);
    gint        gnome_print_job_print           (GnomePrintJob *job);
    gint        gnome_print_job_render          (GnomePrintJob *job,
                                                 GnomePrintContext *ctx);
    gint        gnome_print_job_render_page     (GnomePrintJob *job,
                                                 GnomePrintContext *ctx,
                                                 gint page,
                                                 gboolean pageops);
    gint        gnome_print_job_get_pages       (GnomePrintJob *job);
    gboolean    gnome_print_job_get_page_size_from_config
                                                (GnomePrintConfig *config,
                                                 gdouble *width,
                                                 gdouble *height);
    gint        gnome_print_job_print_to_file   (GnomePrintJob *job,
                                                 gchar *output);

## Description

## Details

### >struct GnomePrintJob

    struct GnomePrintJob;

### >gnome_print_job_new ()

    GnomePrintJob* gnome_print_job_new          (GnomePrintConfig *config);

Creates a new GnomePrintJob.

`config` : | The job options, can be NULL in which case a default GnomePrintConfig is created
Returns : | A new GnomePrintJob, NULL on error

### >gnome_print_job_get_config ()

    GnomePrintConfig* gnome_print_job_get_config
                                                (GnomePrintJob *job);

Gets a referenced pointer to the configuration of the job

`job` : |
Returns : | a referenced GnomePrintConfig for this job, NULL on error

### >gnome_print_job_get_context ()

    GnomePrintContext* gnome_print_job_get_context
                                                (GnomePrintJob *job);

Retrieve the GnomePrintContext which applications print to.

The caller is responsible to unref the context when s/he is done with it.

`job` : | An initialised GnomePrintJob.
Returns : | The printing context, NULL on error

### >gnome_print_job_close ()

    gint        gnome_print_job_close           (GnomePrintJob *job);

Closes the GnomePrintJob `job`, ready for printing or previewing. To be called after the application has finished sending the drawing commands

`job` : | A GnomePrintJob which has had printing performed
Returns : |

### >gnome_print_job_print ()

    gint        gnome_print_job_print           (GnomePrintJob *job);

Print the pages stored in the GnomePrintJob to the phyisical printing device.

`job` : | A closed GnomePrintJob.
Returns : | GNOME_PRINT_OK on success GNOME_PRINT_ERROR_UNKNOWN otherwise

### >gnome_print_job_render ()

    gint        gnome_print_job_render          (GnomePrintJob *job,
                                                 GnomePrintContext *ctx);

Renders printout to specified context (with layout, ignoring copies)

`job` : |
`ctx` : |
Returns : |

### >gnome_print_job_render_page ()

    gint        gnome_print_job_render_page     (GnomePrintJob *job,
                                                 GnomePrintContext *ctx,
                                                 gint page,
                                                 gboolean pageops);

Renders the specified page `page`

`job` : |
`ctx` : |
`page` : |
`pageops` : |
Returns : |

### >gnome_print_job_get_pages ()

    gint        gnome_print_job_get_pages       (GnomePrintJob *job);

Find the number of pages stored in a completed printout. This is the number of physical pages, so if the layout can hold 4 pages per page, and 5 logical pages are printed (5 beginpage/endpage convinations) 2 is returned

`job` : | An initialised and closed GnomePrintJob.
Returns : | the number of pages, 0 on error

### >gnome_print_job_get_page_size_from_config ()

    gboolean    gnome_print_job_get_page_size_from_config
                                                (GnomePrintConfig *config,
                                                 gdouble *width,
                                                 gdouble *height);

Deprecated, use gnome_print_config_get_page_size

`config` : |
`width` : |
`height` : |
Returns : | TRUE on success, FALSE on error

### >gnome_print_job_print_to_file ()

    gint        gnome_print_job_print_to_file   (GnomePrintJob *job,
                                                 gchar *output);

`job` : |
`output` : |
Returns : |