DOKK / manpages / debian 11 / libpappl-dev / pappl-printer.3.en
pappl-printer(3) pappl printer functions pappl-printer(3)

pappl-printer - pappl printer functions

Printer Application Framework (libpappl, "pkg-config --cflags --libs pappl")

#include <pappl/pappl.h>

typedef struct _pappl_printer_s pappl_printer_t;

void
papplPrinterCancelAllJobs(pappl_printer_t *printer);

void
papplPrinterCloseDevice(pappl_printer_t *printer);

pappl_printer_t *
papplPrinterCreate(pappl_system_t *system, int printer_id, const char *printer_name, const char *driver_name, const char *device_id, const char *device_uri);

void
papplPrinterDelete(pappl_printer_t *printer);

pappl_job_t *
papplPrinterFindJob(pappl_printer_t *printer, int job_id);

pappl_contact_t *
papplPrinterGetContact(pappl_printer_t *printer, pappl_contact_t *contact);

const char *
papplPrinterGetDeviceID(pappl_printer_t *printer);

const char *
papplPrinterGetDeviceURI(pappl_printer_t *printer);

char *
papplPrinterGetDNSSDName(pappl_printer_t *printer, char *buffer, size_t bufsize);

ipp_t *
papplPrinterGetDriverAttributes(pappl_printer_t *printer);

pappl_driver_data_t *
papplPrinterGetDriverData(pappl_printer_t *printer, pappl_driver_data_t *data);

const char *
papplPrinterGetDriverName(pappl_printer_t *printer);

char *
papplPrinterGetGeoLocation(pappl_printer_t *printer, char *buffer, size_t bufsize);

int
papplPrinterGetID(pappl_printer_t *printer);

int
papplPrinterGetImpressionsCompleted(pappl_printer_t *printer);

char *
papplPrinterGetLocation(pappl_printer_t *printer, char *buffer, size_t bufsize);

int
papplPrinterGetMaxActiveJobs(pappl_printer_t *printer);

int
papplPrinterGetMaxCompletedJobs(pappl_printer_t *printer);

const char *
papplPrinterGetName(pappl_printer_t *printer);

int
papplPrinterGetNextJobID(pappl_printer_t *printer);

int
papplPrinterGetNumberOfActiveJobs(pappl_printer_t *printer);

int
papplPrinterGetNumberOfCompletedJobs(pappl_printer_t *printer);

int
papplPrinterGetNumberOfJobs(pappl_printer_t *printer);

char *
papplPrinterGetOrganization(pappl_printer_t *printer, char *buffer, size_t bufsize);

char *
papplPrinterGetOrganizationalUnit(pappl_printer_t *printer, char *buffer, size_t bufsize);

char *
papplPrinterGetPrintGroup(pappl_printer_t *printer, char *buffer, size_t bufsize);

pappl_preason_t
papplPrinterGetReasons(pappl_printer_t *printer);

ipp_pstate_t
papplPrinterGetState(pappl_printer_t *printer);

int
papplPrinterGetSupplies(pappl_printer_t *printer, int max_supplies, pappl_supply_t *supplies);

pappl_system_t *
papplPrinterGetSystem(pappl_printer_t *printer);

void
papplPrinterIterateActiveJobs(pappl_printer_t *printer, pappl_job_cb_t cb, void *data, int first_index, int limit);

void
papplPrinterIterateAllJobs(pappl_printer_t *printer, pappl_job_cb_t cb, void *data, int first_index, int limit);

void
papplPrinterIterateCompletedJobs(pappl_printer_t *printer, pappl_job_cb_t cb, void *data, int first_index, int limit);

pappl_device_t *
papplPrinterOpenDevice(pappl_printer_t *printer);

void
papplPrinterPause(pappl_printer_t *printer);

void
papplPrinterResume(pappl_printer_t *printer);

void
papplPrinterSetContact(pappl_printer_t *printer, pappl_contact_t *contact);

void
papplPrinterSetDNSSDName(pappl_printer_t *printer, const char *value);

void
papplPrinterSetDriverData(pappl_printer_t *printer, pappl_driver_data_t *data, ipp_t *attrs);

void
papplPrinterSetDriverDefaults(pappl_printer_t *printer, pappl_driver_data_t *data);

void
papplPrinterSetGeoLocation(pappl_printer_t *printer, const char *value);

void
papplPrinterSetImpressionsCompleted(pappl_printer_t *printer, int add);

void
papplPrinterSetLocation(pappl_printer_t *printer, const char *value);

void
papplPrinterSetMaxActiveJobs(pappl_printer_t *printer, int max_active_jobs);

void
papplPrinterSetMaxCompletedJobs(pappl_printer_t *printer, int max_completed_jobs);

void
papplPrinterSetNextJobID(pappl_printer_t *printer, int next_job_id);

void
papplPrinterSetOrganization(pappl_printer_t *printer, const char *value);

void
papplPrinterSetOrganizationalUnit(pappl_printer_t *printer, const char *value);

void
papplPrinterSetPrintGroup(pappl_printer_t *printer, const char *value);

void
papplPrinterSetReadyMedia(pappl_printer_t *printer, int num_ready, pappl_media_col_t *ready);

void
papplPrinterSetReasons(pappl_printer_t *printer, pappl_preason_t add, pappl_preason_t remove);

void
papplPrinterSetSupplies(pappl_printer_t *printer, int num_supplies, pappl_supply_t *supplies);

void
papplPrinterSetUSB(pappl_printer_t *printer, unsigned vendor_id, unsigned product_id, pappl_uoptions_t options);

The PAPPL printer functions provide access to the printer object. Printers are created and deleted by the printer application while the life cycle of the pappl_printer_t objects are managed automatically by the system object for the printer application.

The papplPrinterCreate function creates a new printer while the papplPrinterDelete function deletes a printer.

The papplPrinterPause function stops a printer while the papplPrinterResume function starts a printer.

The papplPrinterGet functions get the current values associated with a printer while the papplPrinterSet functions set the current values associated with a printer.

The papplPrinterCancelAddJobs, papplPrinterFindJob, papplPrinterGetNumberOfActiveJobs, papplPrinterGetNumberOfCompletedJobs, papplPrinterGetNumberOfJobs, papplPrinterIterateActiveJobs, papplPrinterIterateAllJobs, and papplPrinterIterateCompletedJobs functions provide access to the jobs queued on a printer.

The papplPrinterOpenDevice function provides access to the device associated with a printer when it is not processing a job. The device must be later closed using the papplPrinterCloseDevice function so that the printer can resume job processing.

IPP "print-color-mode" bit values







IPP "print-content-optimize" bit values






Duplex printing support


Duplex with flipped back sides

Duplex with back side rotated 180 degrees for short-edge duplex

No duplex printing support

Duplex with normal back sides

Duplex with back side rotated 180 degrees for long-edge duplex

IPP "finishings" bit values





IPP "identify-actions" bit values




No actions


IPP "printer-kind" bit values










IPP "label-mode-xxx" bit values










IPP "media-tracking" bit values





IPP "printer-state-reasons" bit values



Supported papplDeviceGetStatus bits















IPP "pwg-raster-document-type-supported" bit values


16-bit per component AdobeRGB

8-bit per component AdobeRGB

1-bit (device) black

16-bit (device) black

8-bit (device) black

16-bit per component (device) CMYK

8-bit per component (device) CMYK

Do not force a particular raster type

16-bit per component (device) RGB)

8-bit per component (device) RGB

16-bit grayscale with 2.2 gamma

8-bit grayscale with 2.2 gamma

16-bit per component sRGB

8-bit per component sRGB

IPP "print-scaling" bit values






IPP "sides" bit values




"printer-supply" color values


Black ink/toner (photo or matte)

Cyan ink/toner

Gray ink (sometimes marketed as light gray)

Green ink

Light cyan ink

Light gray ink (sometimes marketed as light light gray)

Light magenta ink

Magenta ink/toner

No color (waste tank, etc.)

Orange ink

Violet ink

Yellow ink/toner

IPP "printer-supply" type values


Banding finisher supplies

Binding finisher supplies

Cleaning unit

Corona wire (laser printers)

Cover finisher supplies

Developer supply

Fuser (laser printers)

Fuser cleaning pad (laser printers)

Fuser oil supply (laser printers)

Fuser oiler (laser printers)

Fuser oil wick (laser printers)

Ink supply

Ink cartridge

Ink ribbon supply

Insert finisher supplies

Optical photoconductor (laser printers)

Wrap finisher supplies

Wax ribbon supply

Solid wax supply

Staple finisher supplies

Staple/stitch finisher supplies

Toner supply

Toner cartridge

Transfer unit (laser printers)

Waste ink

Waste toner

Waste water

Waste wax

Water supply

USB gadget options


Include USB ethernet gadget

No options (just USB printer)

Include USB serial gadget

Include USB mass storage gadget

USB mass storage gadget is read-only

USB mass storage gadget is removable

Cancel all jobs on the printer.

void papplPrinterCancelAllJobs (

pappl_printer_t *printer );

This function cancels all jobs on the printer. If any job is currently being printed, it will be stopped at a convenient time (usually the end of a page) so that the printer will be left in a known state.

Close the device associated with the printer.

void papplPrinterCloseDevice (

pappl_printer_t *printer );

This function closes the device for a printer. The device must have been previously opened using the papplPrinterOpenDevice function.

Create a new printer.

pappl_printer_t * papplPrinterCreate (

pappl_system_t *system,
int printer_id,
const char *printer_name,
const char *driver_name,
const char *device_id,
const char *device_uri );

This function creates a new printer (service) on the specified system. The "type" argument specifies the type of service to create and must currently be the value PAPPL_SERVICE_TYPE_PRINT.

The "printer_id" argument specifies a positive integer identifier that is unique to the system. If you specify a value of 0 a new identifier will be assigned.

The "driver_name" argument specifies a named driver for the printer, from the list of drivers registered with the papplSystemSetPrinterDrivers function.

The "device_id" and "device_uri" arguments specify the IEEE-1284 device ID and device URI strings for the printer.

On error, this function sets the errno variable to one of the following values:

  • EEXIST: A printer with the specified name already exists.
  • EINVAL: Bad values for the arguments were specified.
  • EIO: The driver callback failed.
  • ENOENT: No driver callback has been set.
  • ENOMEM: Ran out of memory.</li> </ul>

Delete a printer.

void papplPrinterDelete (

pappl_printer_t *printer );

This function deletes a printer from a system, freeing all memory and canceling all jobs as needed.

Get the "printer-contact" value.

pappl_contact_t * papplPrinterGetContact (

pappl_printer_t *printer,
pappl_contact_t *contact );

This function copies the current printer contact information to the buffer pointed to by the "contact" argument.

Get the current DNS-SD service name.

char * papplPrinterGetDNSSDName (

pappl_printer_t *printer,
char *buffer,
size_t bufsize );

This function copies the current DNS-SD service name to the buffer pointed to by the "buffer" argument.

Get the IEEE-1284 device ID of the printer.

const char * papplPrinterGetDeviceID (

pappl_printer_t *printer );

This function returns the IEEE-1284 device ID of the printer.

Get the URI of the device associated with the printer.

const char * papplPrinterGetDeviceURI (

pappl_printer_t *printer );

This function returns the device URI for the printer.

Get the current driver attributes.

ipp_t * papplPrinterGetDriverAttributes (

pappl_printer_t *printer );

This function returns the current driver attributes.

Get the current print driver data.

pappl_pr_driver_data_t * papplPrinterGetDriverData (

pappl_printer_t *printer,
pappl_pr_driver_data_t *data );

This function copies the current print driver data, defaults, and ready (loaded) media information into the specified buffer.

Get the driver name for a printer.

const char * papplPrinterGetDriverName (

pappl_printer_t *printer );

This function returns the driver name for the printer.

Get the current geo-location as a "geo:" URI.

char * papplPrinterGetGeoLocation (

pappl_printer_t *printer,
char *buffer,
size_t bufsize );

This function copies the currently configured geographic location as a "geo:" URI to the buffer pointed to by the "buffer" argument.

Get the printer ID.

int  papplPrinterGetID (

pappl_printer_t *printer );

This function returns the printer's unique positive integer identifier.

Get the number of impressions (sides) that have been printed.

int  papplPrinterGetImpressionsCompleted (

pappl_printer_t *printer );

This function returns the number of impressions that have been printed. An impression is one side of an output page.

Get the location string.

char * papplPrinterGetLocation (

pappl_printer_t *printer,
char *buffer,
size_t bufsize );

This function copies the printer's human-readable location to the buffer pointed to by the "buffer" argument.

Get the maximum number of active (queued) jobs allowed by the printer.

int  papplPrinterGetMaxActiveJobs (

pappl_printer_t *printer );

This function returns the maximum number of active jobs that the printer supports, as configured by the papplPrinterSetMaxActiveJobs function.

Get the maximum number of jobs retained for history by the printer.

int  papplPrinterGetMaxCompletedJobs (

pappl_printer_t *printer );

This function returns the maximum number of jobs that are retained in the job history as configured by the papplPrinterSetMaxCompletedJobs function.

Get the printer name.

const char * papplPrinterGetName (

pappl_printer_t *printer );

This function returns the printer's human-readable name.

Get the next job ID.

int  papplPrinterGetNextJobID (

pappl_printer_t *printer );

This function returns the positive integer identifier that will be used for the next job that is created.

Get the number of active print jobs.

int  papplPrinterGetNumberOfActiveJobs (

pappl_printer_t *printer );

This function returns the number of print jobs that are either printing or waiting to be printed.

Get the number of completed print jobs.

int  papplPrinterGetNumberOfCompletedJobs (

pappl_printer_t *printer );

This function returns the number of print jobs that have been aborted, canceled, or completed.

Get the total number of print jobs.

int  papplPrinterGetNumberOfJobs (

pappl_printer_t *printer );

This function returns the number of print jobs that are printing, waiting to be printed, have been aborted, have been canceled, or have completed.

Get the organization name.

char * papplPrinterGetOrganization (

pappl_printer_t *printer,
char *buffer,
size_t bufsize );

This function copies the printer's organization name to the buffer pointed to by the "buffer" argument.

Get the organizational unit name.

char * papplPrinterGetOrganizationalUnit (

pappl_printer_t *printer,
char *buffer,
size_t bufsize );

This function copies the printer's organizational unit name to the buffer pointed to by the "buffer" argument.

Get the URL path for a printer web page.

char * papplPrinterGetPath (

pappl_printer_t *printer,
const char *subpath,
char *buffer,
size_t bufsize );

This function generates and returns the URL path for the printer's web page. The "subpath" argument specifies an optional sub-path for a specific printer web page.

Get the print authorization group, if any.

char * papplPrinterGetPrintGroup (

pappl_printer_t *printer,
char *buffer,
size_t bufsize );

This function copies the printer's authorization group name to the buffer pointed to by the "buffer" argument.

Get the current "printer-state-reasons" bit values.

pappl_preason_t  papplPrinterGetReasons (

pappl_printer_t *printer );

This function returns the current printer state reasons bitfield, which can be updated by the printer driver and/or by the papplPrinterSetReasons function.

Get the current "printer-state" value.

ipp_pstate_t  papplPrinterGetState (

pappl_printer_t *printer );

This function returns the current printer state as an enumeration:

  • IPP_PSTATE_IDLE: The printer is idle and has no jobs to process.
  • IPP_PSTATE_PROCESSING: The printer is processing a job and/or producing output.
  • IPP_PSTATE_STOPPED: The printer is stopped for maintenance.</li> </ul>

Get the current "printer-supplies" values.

int  papplPrinterGetSupplies (

pappl_printer_t *printer,
int max_supplies,
pappl_supply_t *supplies );

This function copies the current printer supply values to the specified array. The "max_supplies" and "supplies" arguments can be 0 and NULL to query the number of supplies used.

The return value is the actual number of supplies used by the printer, regardless of the size of the array.

Get the system associated with the printer.

pappl_system_t * papplPrinterGetSystem (

pappl_printer_t *printer );

This function returns a pointer to the system object that contains the printer.

Iterate over the active jobs.

void papplPrinterIterateActiveJobs (

pappl_printer_t *printer,
pappl_job_cb_t cb,
void *data,
int job_index,
int limit );

This function iterates over jobs that are either printing or waiting to be printed. The specified callback "cb" will be called once per job with the data pointer "data".

The "job_index" argument specifies the first job in the list to iterate, where 1 is the first job, etc. The "limit" argument specifies the maximum number of jobs to iterate - use 0 to iterate an unlimited number of jobs.

Iterate over all the jobs.

void papplPrinterIterateAllJobs (

pappl_printer_t *printer,
pappl_job_cb_t cb,
void *data,
int job_index,
int limit );

This function iterates over all jobs. The specified callback "cb" will be called once per job with the data pointer "data".

The "job_index" argument specifies the first job in the list to iterate, where 1 is the first job, etc. The "limit" argument specifies the maximum number of jobs to iterate - use 0 to iterate an unlimited number of jobs.

Iterate over the completed jobs.

void papplPrinterIterateCompletedJobs (

pappl_printer_t *printer,
pappl_job_cb_t cb,
void *data,
int job_index,
int limit );

This function iterates over jobs that are aborted, canceled, or completed. The specified callback "cb" will be called once per job with the data pointer "data".

The "job_index" argument specifies the first job in the list to iterate, where 1 is the first job, etc. The "limit" argument specifies the maximum number of jobs to iterate - use 0 to iterate an unlimited number of jobs.

Open the device associated with a printer.

pappl_device_t * papplPrinterOpenDevice (

pappl_printer_t *printer );

This function opens the printer's device. NULL is returned if the device is already in use, for example while a job is being printed.

The returned device must be closed using the papplPrinterCloseDevice function.

Pause (stop) a printer.

void papplPrinterPause (

pappl_printer_t *printer );

This function pauses a printer. If the printer is currently processing (printing) a job, it will be completed before the printer is stopped.

Resume (start) a printer.

void papplPrinterResume (

pappl_printer_t *printer );

This function resumes a printer and starts processing any pending jobs.

Set the "printer-contact" value.

void papplPrinterSetContact (

pappl_printer_t *printer,
pappl_contact_t *contact );

This function sets the printer's contact information.

Set the DNS-SD service name.

void papplPrinterSetDNSSDName (

pappl_printer_t *printer,
const char *value );

This function sets the printer's DNS-SD service name. If NULL, the printer will stop advertising the printer.

Set the driver data.

bool  papplPrinterSetDriverData (

pappl_printer_t *printer,
pappl_pr_driver_data_t *data,
ipp_t *attrs );

This function validates and sets the driver data, including all defaults and ready (loaded) media.

Note: This function regenerates all of the driver-specific capability attributes like "media-col-database", "sides-supported", and so forth. Use the papplPrinterSetDriverDefaults or papplPrinterSetReadyMedia functions to efficiently change the > "xxx-default" or "xxx-ready" values, respectively.

Set the default print option values.

bool  papplPrinterSetDriverDefaults (

pappl_printer_t *printer,
pappl_pr_driver_data_t *data,
int num_vendor,
cups_option_t *vendor );

This function validates and sets the printer's default print options.

Note: Unlike papplPrinterSetPrintDriverData, this function only changes the "xxx_default" members of the driver data and is considered lightweight.

Set the geo-location value as a "geo:" URI.

void papplPrinterSetGeoLocation (

pappl_printer_t *printer,
const char *value );

This function sets the printer's geographic location as a "geo:" URI. If NULL, the location is cleared to the 'unknown' value.

Add impressions (sides) to the total count of printed impressions.

void papplPrinterSetImpressionsCompleted (

pappl_printer_t *printer,
int add );

This function adds to the printer's impressions counter. An impression is one side of an output page.

Set the location string.

void papplPrinterSetLocation (

pappl_printer_t *printer,
const char *value );

This function sets the printer's human-readable location string. If NULL, the location is cleared.

Set the maximum number of active jobs for the printer.

void papplPrinterSetMaxActiveJobs (

pappl_printer_t *printer,
int max_active_jobs );

This function sets the maximum number of jobs that can be spooled on the printer at one time.

Note: This limit does not apply to streaming raster formats such as PWG Raster since they are not spooled.

Set the maximum number of completed jobs for the printer.

void papplPrinterSetMaxCompletedJobs (

pappl_printer_t *printer,
int max_completed_jobs );

This function sets the maximum number of aborted, canceled, or completed jobs that are retained in the job history.

Set the next "job-id" value.

void papplPrinterSetNextJobID (

pappl_printer_t *printer,
int next_job_id );

This function sets the next unique positive integer identifier that will be used for a job.

Note: This function is normally only called once to restore the previous state of the printer.

Set the organization name.

void papplPrinterSetOrganization (

pappl_printer_t *printer,
const char *value );

This function sets the printer's organization name. If NULL the value is cleared.

Set the organizational unit name.

void papplPrinterSetOrganizationalUnit (

pappl_printer_t *printer,
const char *value );

This function sets the printer's organizational unit name. If NULL the value is cleared.

Set the print authorization group, if any.

void papplPrinterSetPrintGroup (

pappl_printer_t *printer,
const char *value );

This function sets the printer's authorization group. If NULL, the group is cleared.

Note: The authorization group is only used if the system is created with a named authorization service.

Set the ready (loaded) media.

bool  papplPrinterSetReadyMedia (

pappl_printer_t *printer,
int num_ready,
pappl_media_col_t *ready );

This function validates and sets the printer's ready (loaded) media.

Add or remove values from "printer-state-reasons".

void papplPrinterSetReasons (

pappl_printer_t *printer,
pappl_preason_t add,
pappl_preason_t remove );

This function updates the printer state reasons bitfield by clearing any bit values in the "remove" argument and setting any bit values in the "add" argument.

Set/update the supplies for a printer.

void papplPrinterSetSupplies (

pappl_printer_t *printer,
int num_supplies,
pappl_supply_t *supplies );

This function updates the supply information for the printer.

Set the USB vendor and product IDs for a printer.

void papplPrinterSetUSB (

pappl_printer_t *printer,
unsigned vendor_id,
unsigned product_id,
pappl_uoptions_t options,
const char *storagefile );

This function sets the USB vendor and product IDs for a printer as well as specifying USB gadget options when the printer is registered with the USB device controller.

Note: USB gadget functionality is currently only available when running on Linux with compatible hardware such as the Raspberry Pi.

Printer PNG icon structure

struct pappl_icon_s
{

const void *data;
size_t datalen;
char filename[256]; };

Media details structure

struct pappl_media_col_s
{

int bottom_margin;
int left_margin;
int left_offset;
int right_margin;
int size_length;
char size_name[64];
int size_width;
char source[64];
int top_margin;
int top_offset;
pappl_media_tracking_t tracking;
char type[64]; };

Printer driver data

struct pappl_pr_driver_data_s
{

const char *bin[PAPPL_MAX_BIN];
int bin_default;
bool borderless;
int bottom_top;
pappl_color_mode_t color_default;
pappl_color_mode_t color_supported;
pappl_content_t content_default;
int darkness_configured;
int darkness_default;
int darkness_supported;
pappl_pr_delete_cb_t delete_cb;
pappl_duplex_t duplex;
void *extension;
const char *features[PAPPL_MAX_VENDOR];
pappl_finishings_t finishings;
pappl_raster_type_t force_raster_type;
const char *format;
pappl_dither_t gdither;
bool has_supplies;
pappl_icon_t icons[3];
pappl_pr_identify_cb_t identify_cb;
pappl_identify_actions_t identify_default;
pappl_identify_actions_t identify_supported;
bool input_face_up;
pappl_kind_t kind;
int left_offset_supported[2];
int left_right;
char make_and_model[128];
const char *media[PAPPL_MAX_MEDIA];
pappl_media_col_t media_default;
pappl_media_col_t media_ready[PAPPL_MAX_SOURCE];
pappl_label_mode_t mode_configured;
pappl_label_mode_t mode_supported;
int num_bin;
int num_features;
int num_media;
int num_resolution;
int num_source;
int num_type;
int num_vendor;
ipp_orient_t orient_default;
bool output_face_up;
pappl_dither_t pdither;
int ppm;
int ppm_color;
pappl_pr_printfile_cb_t printfile_cb;
ipp_quality_t quality_default;
pappl_raster_type_t raster_types;
pappl_pr_rendjob_cb_t rendjob_cb;
pappl_pr_rendpage_cb_t rendpage_cb;
pappl_pr_rstartjob_cb_t rstartjob_cb;
pappl_pr_rstartpage_cb_t rstartpage_cb;
pappl_pr_rwriteline_cb_t rwriteline_cb;
pappl_scaling_t scaling_default;
pappl_sides_t sides_default;
pappl_sides_t sides_supported;
const char *source[PAPPL_MAX_SOURCE];
int speed_default;
int speed_supported[2];
pappl_pr_status_cb_t status_cb;
int tear_offset_configured;
int tear_offset_supported[2];
pappl_pr_testpage_cb_t testpage_cb;
int top_offset_supported[2];
pappl_media_tracking_t tracking_supported;
const char *type[PAPPL_MAX_TYPE];
const char *vendor[PAPPL_MAX_VENDOR];
int x_default;
int x_resolution[PAPPL_MAX_RESOLUTION];
int y_default;
int y_resolution[PAPPL_MAX_RESOLUTION]; };

Combined print job options

struct pappl_pr_options_s
{

int copies;
int darkness_configured;
pappl_dither_t dither;
pappl_finishings_t finishings;
unsigned first_page;
cups_page_header2_t header;
unsigned last_page;
pappl_media_col_t media;
unsigned num_pages;
int num_vendor;
ipp_orient_t orientation_requested;
char output_bin[64];
pappl_color_mode_t print_color_mode;
pappl_content_t print_content_optimize;
int print_darkness;
ipp_quality_t print_quality;
pappl_scaling_t print_scaling;
int print_speed;
int printer_resolution[2];
pappl_sides_t sides;
cups_option_t *vendor; };

Supply data

struct pappl_supply_s
{

pappl_supply_color_t color;
char description[256];
bool is_consumed;
int level;
pappl_supply_type_t type; };

Bitfield for IPP "print-color-mode" values

typedef unsigned pappl_color_mode_t;

Bitfield for IPP "print-content-optimize" values

typedef unsigned pappl_content_t;

papplIterateDefaults callback

typedef void (*pappl_default_cb_t)(ipp_attribute_t *attr, void *data);

Duplex printing support

typedef enum pappl_duplex_e pappl_duplex_t;

Bitfield for IPP "finishings" values

typedef unsigned pappl_finishings_t;

Printer PNG icon structure

typedef struct pappl_icon_s pappl_icon_t;

Bitfield for IPP "identify-actions" values

typedef unsigned pappl_identify_actions_t;

papplIterateXxxJobs callback function

typedef void (*pappl_job_cb_t)(pappl_job_t *job, void *data);

Bitfield for IPP "printer-kind" values

typedef unsigned pappl_kind_t;

Bitfield for IPP "label-mode-xxx" values

typedef unsigned short pappl_label_mode_t;

Media details structure

typedef struct pappl_media_col_s pappl_media_col_t;

Bitfield for IPP "media-tracking" values

typedef unsigned short pappl_media_tracking_t;

Printer deletion callback

typedef void (*pappl_pr_delete_cb_t)(pappl_printer_t *printer, pappl_pr_driver_data_t *data);

Identify-Printer callback

typedef void (*pappl_pr_identify_cb_t)(pappl_printer_t *printer, pappl_identify_actions_t actions, const char *message);

Print a "raw" job callback

typedef bool (*pappl_pr_printfile_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);

End a raster job callback

typedef bool (*pappl_pr_rendjob_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);

End a raster page callback

typedef bool (*pappl_pr_rendpage_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned page);

Start a raster job callback

typedef bool (*pappl_pr_rstartjob_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);

Start a raster page callback

typedef bool (*pappl_pr_rstartpage_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned page);

Write a line of raster graphics callback

typedef bool (*pappl_pr_rwriteline_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned y, const unsigned char *line);

Update printer status callback

typedef bool (*pappl_pr_status_cb_t)(pappl_printer_t *printer);

Print a test page callback

typedef const char * (*pappl_pr_testpage_cb_t)(pappl_printer_t *printer, char *buffer, size_t bufsize);

Bitfield for IPP "pwg-raster-document-type-supported" values

typedef unsigned pappl_raster_type_t;

Bitfield for IPP "print-scaling" values

typedef unsigned pappl_scaling_t;

Bitfield for IPP "sides" values

typedef unsigned pappl_sides_t;

"printer-supply" color values

typedef enum pappl_supply_color_e pappl_supply_color_t;

Supply data

typedef struct pappl_supply_s pappl_supply_t;

IPP "printer-supply" type values

typedef enum pappl_supply_type_e pappl_supply_type_t;

USB gadget options bitfield

typedef unsigned pappl_uoptions_t;

pappl(1), pappl-client(3), pappl-device(3), pappl-job(3), pappl-log(3), pappl-mainline(3), pappl-makeresheader(1), pappl-printer(3), pappl-resource(3), pappl-system(3), https://www.msweet.org/pappl

Copyright © 2019-2020 by Michael R Sweet.

PAPPL is licensed under the Apache License Version 2.0 with an (optional) exception to allow linking against GPL2/LGPL2 software (like older versions of CUPS), so it can be used freely in any project you'd like. See the files "LICENSE" and "NOTICE" in the source distribution for more information.

pappl printer functions 2020-12-08