-
-
Notifications
You must be signed in to change notification settings - Fork 42
Media UI
Michael R Sweet edited this page Mar 22, 2025
·
4 revisions
LPrint provides a custom media chooser that allows users to configure custom label sizes for a printer.
Source files:
- "lprint-common.c": Functions
- "lprint.h": Definitions
typedef struct lprint_cmedia_s // Custom label sizes (per-printer/source)
{
char custom_name[PAPPL_MAX_SOURCE][128]; // Custom media size names
} lprint_cmedia_t;The lprint_cmedia_t structure records custom label sizes for each media source. Each custom_name string is a PWG self-describing media size name.
bool // O - `true` on success, `false` on error
lprintMediaLoad(
pappl_printer_t *printer, // I - Printer
pappl_pr_driver_data_t *data) // I - Printer driver dataLoad custom label sizes for a printer.
const char * // O - Matching media size or `NULL` if none
lprintMediaMatch(
pappl_printer_t *printer, // I - Printer
int source, // I - "media-source" index (0-based)
int width, // I - Width in hundredths of millimeters or `0` if unknown
int length) // I - Length in hundredths of millimetersMatch the loaded media to one of the supported or custom sizes.
bool // O - `true` on success, `false` on error
lprintMediaSave(
pappl_printer_t *printer, // I - Printer
pappl_pr_driver_data_t *data) // I - Printer driver dataSave custom label sizes for a printer.
bool // O - `true` on success, `false` on error
lprintMediaUI(
pappl_client_t *client, // I - HTTP client
pappl_printer_t *printer) // I - PrinterShow the printer media web page. This replaces the standard PAPPL "/media" page.
void
lprintMediaUpdate(
pappl_printer_t *printer, // I - Printer
pappl_pr_driver_data_t *data) // I - Printer driver dataUpdate the list of custom label sizes for a printer.