Changes between Version 9 and Version 10 of Docs/825gen2/Dev/Devices/USB/PrintersCUPS
- Timestamp:
- 01/21/24 14:48:38 (10 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/825gen2/Dev/Devices/USB/PrintersCUPS
v9 v10 119 119 The Star printer driver seems to only work for BMP files. Tried other graphics formats such as PNG and JPEG but only black tickets printed. 120 120 121 Found an example of cups printing on stackoverflow.com. After compile the example for the 825 and after making several changing get it to work to programatically print a ticket.121 There is some example code of cups printing on stackoverflow.com. This can be compiled for the 825. Some changes were needed to get it to work. 122 122 123 123 {{{ … … 132 132 #define HEIGHT 500 133 133 134 135 #define TEST_BMP_FILENAME "/tmp/tkt9.bmp"136 137 138 134 int main(int argc, char** argv) { 139 135 … … 143 139 144 140 mkstemp(tmpFilepath); 145 printf("tmpFilename [%s]\n", tmpFilepath);141 printf("tmpFilename [%s]\n", tmpFilepath); 146 142 147 143 148 // cairo_surface_t* surface = cairo_ps_surface_create(tmpfilename, WIDTH, HEIGHT); 149 cairo_surface_t* surface = cairo_image_surface_create(/*CAIRO_FORMAT_ARGB32*/ /*CAIRO_FORMAT_RGB24*/ CAIRO_FORMAT_A1, WIDTH, HEIGHT); 150 printf("after surface create %d\n", cairo_surface_get_type(surface)); 144 cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_A1, WIDTH, HEIGHT); 151 145 cairo_t *context = cairo_create(surface); 152 153 146 154 147 LoadBMPToSurface("/usr/images/bird.bmp", surface, 0, 0); … … 185 178 // printf("write_to_png result %d\n", n); 186 179 187 188 180 cairo_surface_destroy(surface); 189 181