Changes between Version 9 and Version 10 of Docs/825gen2/Dev/Devices/USB/PrintersCUPS


Ignore:
Timestamp:
01/21/24 14:48:38 (10 months ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/825gen2/Dev/Devices/USB/PrintersCUPS

    v9 v10  
    119119The Star printer driver seems to only work for BMP files. Tried other graphics formats such as PNG and JPEG but only black tickets printed.
    120120
    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.
     121There 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.
    122122
    123123{{{
     
    132132#define HEIGHT 500
    133133
    134 
    135 #define TEST_BMP_FILENAME "/tmp/tkt9.bmp"
    136 
    137 
    138134int main(int argc, char** argv) {
    139135
     
    143139
    144140  mkstemp(tmpFilepath);
    145  printf("tmpFilename [%s]\n", tmpFilepath);
     141  printf("tmpFilename [%s]\n", tmpFilepath);
    146142
    147143
    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);
    151145  cairo_t *context = cairo_create(surface);
    152 
    153146
    154147  LoadBMPToSurface("/usr/images/bird.bmp", surface, 0, 0);
     
    185178 // printf("write_to_png result %d\n", n);
    186179
    187 
    188180  cairo_surface_destroy(surface);
    189181