static int ljet4pjl_close(gx_device *pdev) { gx_device_printer *const ppdev = (gx_device_printer *)pdev; int code = gdev_prn_open_printer(pdev, 1); if (code < 0) return code; if ( ppdev->Duplex_set >= 0 && ppdev->Duplex ) { gdev_prn_open_printer(pdev, 1); fputs("\033&l0H", ppdev->file) ; } fputs("\033%-12345X", ppdev->file); return gdev_prn_close(pdev); }
static int npdl_close(gx_device *pdev) { gx_device_printer *const ppdev = (gx_device_printer *) pdev; gdev_prn_open_printer(pdev, 1); fputs("\033c1", ppdev->file); return gdev_prn_close(pdev); }
/* Close the printer, writing the stream trailer. */ static int ljet5_close(gx_device * pdev) { gx_device_printer *const ppdev = (gx_device_printer *)pdev; int code = gdev_prn_open_printer(pdev, true); if (code < 0) return code; px_write_file_trailer(ppdev->file); return gdev_prn_close(pdev); }
static int escpage_close(gx_device * pdev) { gdev_prn_open_printer(pdev, 1); if (ppdev->Duplex && (pdev->PageCount & 1)) { fprintf(ppdev->file, "%c0dpsE", GS); } fputs(epson_remote_start, ppdev->file); fputs(epson_remote_start, ppdev->file); return gdev_prn_close(pdev); }
static int ml600_close( gx_device *pdev) { int code = gdev_prn_open_printer(pdev, true); FILE *prn_stream; /* dprintf("gdevml6: ml600_close called\n"); */ if (code < 0) return code; prn_stream = ppdev->file; ml_finish(ppdev, prn_stream); return gdev_prn_close(pdev); }
/* and to reset the printer so the ink cartridge doesn't clog up. */ static int hpjet_close(gx_device * pdev) { gx_device_printer *const ppdev = (gx_device_printer *)pdev; int code = gdev_prn_open_printer(pdev, 1); if (code < 0) return code; if (ppdev->PageCount > 0) { if (ppdev->Duplex_set >= 0 && ppdev->Duplex) fputs("\033&l0H", ppdev->file); fputs("\033E", ppdev->file); } return gdev_prn_close(pdev); }
static int ml600_open( gx_device *pdev) { int code = gdev_prn_open(pdev); FILE *prn_stream; /* dprintf("gdevml6: ml600_open called\n");*/ if (code < 0) return code; code = gdev_prn_open_printer(pdev, true); if (code < 0) return code; prn_stream = ppdev->file; return ml_init(ppdev, prn_stream); }
/* Open the printer, writing the stream header. */ static int ljet5_open(gx_device * pdev) { int code = gdev_prn_open(pdev); if (code < 0) return code; code = gdev_prn_open_printer(pdev, true); if (code < 0) return code; { gx_device_printer *const ppdev = (gx_device_printer *)pdev; stream fs; stream *const s = &fs; byte buf[50]; /* arbitrary */ s_init(s, pdev->memory); swrite_file(s, ppdev->file, buf, sizeof(buf)); px_write_file_header(s, pdev); sflush(s); /* don't close */ } return 0; }
static int cp50_output_page(gx_device *pdev, int num_copies, int flush) { int code, outcode, closecode; code = gdev_prn_open_printer(pdev, 1); if ( code < 0 ) return code; copies = num_copies; /* using global variable to pass */ /* Print the accumulated page description. */ outcode = (*ppdev->printer_procs.print_page)(ppdev, ppdev->file); if ( code < 0 ) return code; closecode = gdev_prn_close_printer(pdev); if ( code < 0 ) return code; if ( ppdev->buffer_space ) /* reinitialize clist for writing */ code = (*gs_clist_device_procs.output_page)(pdev, num_copies, flush); if ( outcode < 0 ) return outcode; if ( closecode < 0 ) return closecode; if ( code < 0 ) return code; return gx_finish_output_page(pdev, num_copies, flush); }