/* * Default X and Y resolution. */ #define X_DPI 72 #define Y_DPI 72 static dev_proc_print_page(miff24_print_page); static const gx_device_procs miff24_procs = prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close, gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb); const gx_device_printer gs_miff24_device = prn_device(miff24_procs, "miff24", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, /* margins */ 24, miff24_print_page); /* Print one page in 24-bit RLE direct color format. */ static int miff24_print_page(gx_device_printer * pdev, FILE * file) { int raster = gx_device_raster((gx_device *) pdev, true); byte *line = gs_alloc_bytes(pdev->memory, raster, "miff line buffer"); int y; int code = 0; /* return code */ if (line == 0) /* can't allocate line buffer */ return_error(gs_error_VMerror); fputs("id=ImageMagick\n", file);
#define MIN_SKIP_LINES 2 /* We round up the LINE_SIZE to a multiple of a ulong for faster scanning. */ #define W sizeof(word) static dev_proc_open_device(ljet5_open); static dev_proc_close_device(ljet5_close); static dev_proc_print_page(ljet5_print_page); static const gx_device_procs ljet5_procs = prn_procs(ljet5_open, gdev_prn_output_page, ljet5_close); const gx_device_printer gs_lj5mono_device = prn_device(ljet5_procs, "lj5mono", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, 1, ljet5_print_page); static const gx_device_procs lj5gray_procs = prn_color_procs(ljet5_open, gdev_prn_output_page, ljet5_close, gx_default_gray_map_rgb_color, gx_default_gray_map_color_rgb); const gx_device_printer gs_lj5gray_device = { prn_device_body(gx_device_printer, lj5gray_procs, "lj5gray", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, 1, 8, 255, 0, 256, 1, ljet5_print_page) };
PC-PR1000/4 "nec400" 400 60 18 */ #define WIDTH 80 /* width_10ths, 8" */ #define HEIGHT 110 /* height_10ths, 11" */ enum{PR201, PR1000, PR150, PR1K4}; static dev_proc_print_page(pr201_print_page); /* The device descriptor */ gx_device_printer gs_pr201_device = prn_device(prn_std_procs, "pr201", WIDTH, HEIGHT, 160, 160, 0,0,0,0, /* margins */ 1, pr201_print_page); gx_device_printer gs_pr1000_device = prn_device(prn_std_procs, "pr1000", WIDTH, HEIGHT, 240, 240, 0,0,0,0, /* margins */ 1, pr201_print_page); gx_device_printer gs_pr150_device = prn_device(prn_std_procs, "pr150",
#define X_DPI 300 #define Y_DPI 300 #define LINE_SIZE ((X_DPI * 85 / 10 + 7) / 8) /* bytes per line */ /* The device descriptors */ static dev_proc_print_page(lbp8_print_page); #ifdef NOCONTRIB static dev_proc_print_page(lips3_print_page); #endif const gx_device_printer far_data gs_lbp8_device = prn_device(prn_std_procs, "lbp8", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0.16, 0.2, 0.32, 0.21, /* margins: left, bottom, right, top */ 1, lbp8_print_page); #ifdef NOCONTRIB const gx_device_printer far_data gs_lips3_device = prn_device(prn_std_procs, "lips3", 82, /* width_10ths, 8.3" */ 117, /* height_10ths, 11.7" */ X_DPI, Y_DPI, 0.16, 0.27, 0.23, 0.27, /* margins */ 1, lips3_print_page); #endif /* ------ Internal routines ------ */
static dev_proc_open_device(sparc_open); static dev_proc_print_page(sparc_print_page); #define SPARC_MARGINS_A4 0.15, 0.12, 0.12, 0.15 #define SPARC_MARGINS_LETTER 0.15, 0.12, 0.12, 0.15 /* Since the print_page doesn't alter the device, this device can print in the background */ gx_device_procs prn_sparc_procs = prn_procs(sparc_open, gdev_prn_bg_output_page, gdev_prn_close); const gx_device_printer far_data gs_sparc_device = prn_device(prn_sparc_procs, "sparc", DEFAULT_WIDTH_10THS,DEFAULT_HEIGHT_10THS, 400,400, 0,0,0,0, 1, sparc_print_page); /* Open the printer, and set the margins. */ static int sparc_open(gx_device *pdev) { /* Change the margins according to the paper size. */ const float *m; static const float m_a4[4] = { SPARC_MARGINS_A4 }; static const float m_letter[4] = { SPARC_MARGINS_LETTER }; m = (pdev->height / pdev->y_pixels_per_inch >= 11.1 ? m_a4 : m_letter); gx_device_set_margins(pdev, m, true); return gdev_prn_open(pdev);
* the printing. * * Dot Matrix Code by Mark Wedel ([email protected]) */ #include "gdevprn.h" /* The device descriptors */ static dev_proc_print_page(dmp_print_page); /* Standard DMP device */ const gx_device_printer far_data gs_appledmp_device = prn_device(prn_std_procs, "appledmp", 85, /* width_10ths, 8.5" */ 110, /* height_10ths, 11" */ 120, 72, /* X_DPI, Y_DPI */ 0, 0.5, 0.5, 0, /* margins */ 1, dmp_print_page); /* lowrez Imagewriter device */ const gx_device_printer far_data gs_iwlo_device = prn_device(prn_std_procs, "iwlo", 85, /* width_10ths, 8.5" */ 110, /* height_10ths, 11" */ 160, 72, /* X_DPI, Y_DPI */ 0, 0.5, 0.5, 0, /* margins */ 1, dmp_print_page); /* hirez Imagewriter device */
/* .BMP file format output drivers */ #include "gdevprn.h" #include "gdevpccm.h" #include "gdevbmp.h" /* ------ The device descriptors ------ */ static dev_proc_print_page(bmp_print_page); static dev_proc_print_page(bmp_cmyk_print_page); /* Monochrome. */ const gx_device_printer gs_bmpmono_device = prn_device(prn_std_procs, "bmpmono", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, /* margins */ 1, bmp_print_page); /* 8-bit (SuperVGA-style) grayscale . */ /* (Uses a fixed palette of 256 gray levels.) */ static const gx_device_procs bmpgray_procs = prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close, gx_default_gray_map_rgb_color, gx_default_gray_map_color_rgb); const gx_device_printer gs_bmpgray_device = { prn_device_body(gx_device_printer, bmpgray_procs, "bmpgray", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, /* margins */ 1, 8, 255, 0, 256, 0, bmp_print_page)
/* We round up the LINE_SIZE to a multiple of a ulong for faster scanning. */ typedef ulong word; #define W sizeof(word) /* Printer types */ #define LW 0 /* The device descriptors */ static dev_proc_print_page(coslw_print_page); const gx_device_printer gs_coslw2p_device = prn_device(prn_std_procs, "coslw2p", 200, 400, /* 2 inches wide */ 128, 128, /* 5 dots per mm */ 0, 0, 0, 0, 1, coslw_print_page); const gx_device_printer gs_coslwxl_device = prn_device(prn_std_procs, "coslwxl", 200, 400, /* 2 inches wide */ 204, 204, /* 8 dots per mm */ 0, 0, 0, 0, 1, coslw_print_page); /* ------ Internal routines ------ */ /* Send the page to the printer. */ static int coslw_print_page(gx_device_printer * pdev, FILE * prn_stream)
#include "gdevprn.h" #define mm_to_inch(x) (x)/25.4 /* The device descriptor */ static dev_proc_print_page(lbp310PrintPage); static dev_proc_print_page(lbp320PrintPage); gx_device_printer far_data gs_lbp310_device = prn_device(prn_std_procs, "lbp310", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 600, 600, mm_to_inch(5.0), mm_to_inch(5.0), mm_to_inch(5.0), mm_to_inch(5.0), 1, lbp310PrintPage); gx_device_printer far_data gs_lbp320_device = prn_device(prn_std_procs, "lbp320", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 600, 600, mm_to_inch(5.0), mm_to_inch(5.0), mm_to_inch(5.0), mm_to_inch(5.0),
* <Esc>J<n> Make a n/180 inch linefeed * <Esc>\<a><b> Move the print position (a+256b)/180 inch to the right * <Esc>*<m><a><b>... Print graphics; m=39: 180*180 dpi * m=40: 360*180 dpi * m=71: 180*360 dpi * m=72: 360*360 dpi * a+256b columns is printed. */ /* The device descriptor */ static dev_proc_print_page(sj48_print_page); gx_device_printer far_data gs_sj48_device = prn_device(prn_bg_procs, "sj48", /* The print_page proc is compatible with allowing bg printing */ 80, /* width_10ths, 8" */ 105, /* height_10ths, 10.5" */ 360, /* x_dpi */ 360, /* y_dpi */ 0,0,0,0, /* margins */ 1, sj48_print_page); /* This comes from the bj10/bj200 source. I don't know how it applies * for a StarJet. --- Mats kerblom. * * * The following is taken from the BJ200 Programmer's manual. The top * margin is 3mm (0.12"), and the bottom margin is 6.4mm (0.25"). The * left and right margin depend on the type of paper -- US letter or * A4 -- but ultimately rest on a print width of 203.2mm (8"). For letter * paper, the left margin (and hence the right) is 6.4mm (0.25"), while * for A4 paper, both are 3.4mm (0.13"). *
/* The device descriptor */ static dev_proc_print_page(cp50_print_page); static dev_proc_output_page(cp50_output_page); static dev_proc_map_rgb_color(cp50_rgb_color); static dev_proc_map_color_rgb(cp50_color_rgb); static gx_device_procs cp50_procs = prn_color_procs(gdev_prn_open, cp50_output_page, gdev_prn_close, cp50_rgb_color, cp50_color_rgb); const gx_device_printer far_data gs_cp50_device = prn_device(cp50_procs, "cp50", 39, /* width_10ths, 100mm */ 59, /* height_10ths,150mm */ X_DPI, Y_DPI, 0.39, 0.91, 0.43, 0.75, /* margins */ 24, cp50_print_page); int copies; /* ------ Internal routines ------ */ /* Send the page to the printer. */ static int cp50_print_page(gx_device_printer *pdev, FILE *prn_stream) { int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev); byte *out = (byte *)gs_malloc(pdev->memory, line_size, 1, "cp50_print_page(out)"); byte *r_plane = (byte *)gs_malloc(pdev->memory, X_PIXEL*Y_PIXEL, 1, "cp50_print_page(r_plane)");
* Epson AP3250 Margins: */ #define AP3250_L_MARGIN 0.18 #define AP3250_B_MARGIN 0.51 #define AP3250_T_MARGIN 0.34 #define AP3250_R_MARGIN 0.28 /* US paper */ /* The device descriptor */ private dev_proc_print_page(escp2_print_page); /* Stylus 800 device */ const gx_device_printer far_data gs_st800_device = prn_device(prn_std_procs, "st800", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, STYLUS_L_MARGIN, STYLUS_B_MARGIN, STYLUS_R_MARGIN, STYLUS_T_MARGIN, 1, escp2_print_page); /* AP3250 device */ const gx_device_printer far_data gs_ap3250_device = prn_device(prn_std_procs, "ap3250", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, AP3250_L_MARGIN, AP3250_B_MARGIN, AP3250_R_MARGIN, AP3250_T_MARGIN, 1, escp2_print_page); /* ------ Internal routines ------ */ /* Send the page to the printer. */
/* $Id: gdevdm24.c,v 1.8 2004/08/04 23:33:29 stefan Exp $*/ /* High-res 24Dot-matrix printer driver */ /* Supported printers * NEC P6 and similar, implemented by Andreas Schwab ([email protected]) * Epson LQ850, implemented by Christian Felsch ([email protected]) */ /* Driver for NEC P6 */ private dev_proc_print_page (necp6_print_page); const gx_device_printer far_data gs_necp6_device = prn_device (prn_std_procs, "necp6", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 360, 360, 0, 0, 0.5, 0, /* margins */ 1, necp6_print_page); /* Driver for Epson LQ850 */ /* I've tested this driver on a BJ300 with LQ850 emulation and there it produce correct 360x360dpi output. */ private dev_proc_print_page (lq850_print_page); const gx_device_printer gs_lq850_device = prn_device (prn_std_procs, "lq850", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 360, 360, 0, 0, 0.5, 0, /* margins */ 1, lq850_print_page); /* ------ Internal routines ------ */
#endif #ifndef Y_DPI # define Y_DPI (1*Y_BASERES) #endif /* The device descriptors */ static dev_proc_print_page(epson_print_page); static dev_proc_print_page(eps9mid_print_page); static dev_proc_print_page(eps9high_print_page); static dev_proc_print_page(ibmpro_print_page); /* Standard Epson device */ const gx_device_printer far_data gs_epson_device = prn_device(prn_std_procs, "epson", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0.25, 0.02, 0.25, 0.4, /* margins */ 1, epson_print_page); /* Mid-res (interleaved, 1 pass per line) 9-pin device */ const gx_device_printer far_data gs_eps9mid_device = prn_device(prn_std_procs, "eps9mid", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, 3*Y_BASERES, 0.2, 0.0, 0, 0.0, /* margins */ 1, eps9mid_print_page); /* High-res (interleaved) 9-pin device */ const gx_device_printer far_data gs_eps9high_device = prn_device(prn_std_procs, "eps9high",
static dev_proc_get_initial_matrix(bj10v_get_initial_matrix); #endif #if 0 gx_device_procs prn_bj10v_procs = prn_matrix_procs(gdev_prn_open, bj10v_get_initial_matrix, gdev_prn_output_page, gdev_prn_close); #endif gx_device_procs prn_bj10v_procs = prn_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close); gx_device_printer gs_bj10v_device = prn_device(prn_bj10v_procs, "bj10v", DEFAULT_WIDTH_10THS, /* width_10ths */ DEFAULT_HEIGHT_10THS, /* height_10ths */ 360, /* x_dpi */ 360, /* y_dpi */ 0.134, 0.507, 0.166, 0.867, /* l, b, r, t margins */ 1, bj10v_print_page); gx_device_printer gs_bj10vh_device = prn_device(prn_bj10v_procs, "bj10vh", DEFAULT_WIDTH_10THS, /* width_10ths */ DEFAULT_HEIGHT_10THS, /* height_10ths */ 360, /* x_dpi */ 360, /* y_dpi */ 0.134, 0.507, 0.166, 0.335, /* l, b, r, t margins */ 1, bj10v_print_page); /* ------ Internal routines ------ */
/* gdevjj100.c */ /* Star JJ-100 printer driver for Ghostscript */ #include "gdevprn.h" static dev_proc_print_page(jj100_print_page); /* * The only available resolutions are 360 x 360. */ /* The device descriptor */ gx_device_printer gs_jj100_device = prn_device(prn_std_procs, "jj100", 82, /* width_10ths, 8.2" = 210mm(A4) */ 115 /*113, 117*/, /* height_10ths, 11.7" = 297mm(A4) */ 360, /* x_dpi */ 360, /* y_dpi */ 0,0,0,0, /* margins */ 1, jj100_print_page); /* ------ internal routines ------ */ /* Transpose a block of 8x8 bits */ static int jj100_transpose_8x8(byte *src, int src_step, byte *dst, int dst_step) { byte mask, s, d0, d1, d2, d3, d4, d5, d6, d7; int i; d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = 0;
static dev_proc_print_page(png_print_page); static dev_proc_open_device(pngalpha_open); static dev_proc_encode_color(pngalpha_encode_color); static dev_proc_decode_color(pngalpha_decode_color); static dev_proc_copy_alpha(pngalpha_copy_alpha); static dev_proc_fill_rectangle(pngalpha_fill_rectangle); static dev_proc_get_params(pngalpha_get_params); static dev_proc_put_params(pngalpha_put_params); static dev_proc_create_buf_device(pngalpha_create_buf_device); /* Monochrome. */ const gx_device_printer gs_pngmono_device = prn_device(prn_std_procs, "pngmono", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, /* margins */ 1, png_print_page); /* 4-bit planar (EGA/VGA-style) color. */ static const gx_device_procs png16_procs = prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close, pc_4bit_map_rgb_color, pc_4bit_map_color_rgb); const gx_device_printer gs_png16_device = { prn_device_body(gx_device_printer, png16_procs, "png16", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, /* margins */ 3, 4, 1, 1, 2, 2, png_print_page) };
*/ #include "gdevprn.h" /* The device descriptors */ static dev_proc_open_device(ml600_open); static dev_proc_close_device(ml600_close); static dev_proc_print_page(ml600_print_page); static gx_device_procs ml600_procs = prn_procs(ml600_open, gdev_prn_output_page, ml600_close); gx_device_printer gs_ml600_device = prn_device(ml600_procs, "ml600", 83, /* width_10ths, 8.3" */ 117, /* height_10ths, 11.7" */ 600, 600, 0.20, 0.20, 0.20, 0.20, /* margins, lbrt */ 1, ml600_print_page); /* ------ prototype ------ */ static int ml_finish( gx_device_printer *pdev, FILE *fp); static int ml_init( gx_device_printer *pdev, FILE *fp); static int
static dev_proc_print_page(tekink_print_page); /* Since the print_page doesn't alter the device, this device can print in the background */ static gx_device_procs tekink_procs = prn_color_procs(gdev_prn_open, gdev_prn_bg_output_page, gdev_prn_close, tekink_map_rgb_color, tekink_map_color_rgb); /* Device descriptor for the Tek 4696. The 4696 plotter uses roll media, thus the y size is arbitrary. The value below is chosen to make the image area A*-format like, i.e. the aspect ratio is close to sqrt(2). */ const gx_device_printer far_data gs_tek4696_device = prn_device(tekink_procs,"tek4696", 85,120, /* Page size in 10th of inches */ 120,120, /* Resolution in DPI */ 0.0,0.0,0.0,0.0, /* Margins */ 4, /* Bits per pixel */ tekink_print_page); /* Color mapping. The tek inkjets use subtractive colors B=0 M=1 Y=2 C=3. These are represented as 4 bits B=1 M=2 Y=4 C=8 in a byte. This gives: White = 0 Black = 1 Magenta = 2 Yellow = 4 Red = 6 Cyan = 8 Blue = 10 Green = 12 The remaining values are unused. (They give ugly results if sent to the
#define W sizeof(word) #define byte unsigned char /* The device descriptors */ static dev_proc_open_device(oki4w_open); static dev_proc_close_device(oki4w_close); static dev_proc_print_page(oki4w_print_page); static gx_device_procs prn_hp_procs = prn_params_procs(oki4w_open, gdev_prn_output_page, oki4w_close, gdev_prn_get_params, gdev_prn_put_params); gx_device_printer far_data gs_oki4w_device = prn_device(prn_hp_procs, "oki4w", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0, 0, 0, 0, /* margins filled in by oki4w_open */ 1, oki4w_print_page); #define ppdev ((gx_device_printer *)pdev) /* Find out paper size code */ static int oki_paper_size(gx_device *dev) { float height_inches = dev->height / dev->y_pixels_per_inch; return height_inches >= 15.9 ? 0x1b/*PAPER_SIZE_A3*/ : height_inches >= 11.8 ? 0x03/*PAPER_SIZE_LEGAL*/ : height_inches >= 11.1 ? 0x1a /*PAPER_SIZE_A4*/ : height_inches >= 8.3 ? 0x02 /*PAPER_SIZE_LETTER*/ :
#define BJ200_BOTTOM_MARGIN 0.29 #define BJ200_LETTER_SIDE_MARGIN 0.25 #define BJ200_A4_SIDE_MARGIN 0.13 static dev_proc_open_device(bj200_open); static dev_proc_print_page(bj10e_print_page); static gx_device_procs prn_bj200_procs = prn_procs(bj200_open, gdev_prn_output_page, gdev_prn_close); const gx_device_printer far_data gs_bj200_device = prn_device(prn_bj200_procs, "bj200", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 360, /* x_dpi */ 360, /* y_dpi */ 0, 0, 0, 0, /* margins filled in by bj200_open */ 1, bj10e_print_page); /* * (<*****@*****.**>, aka <*****@*****.**>): * My bj10ex, which as far as I can tell is just like a bj10e, needs a * bottom margin of 0.4" (actually, you must not print within 0.5" of * the bottom; somewhere, an extra 0.1" is creeping in). * * (<*****@*****.**>): * I have a BJ10sx and the BJ10sx manual. This states that the top and * bottom margins for the BJ10sx are 0.33" and 0.5". The latter may * explain Simon's finding. The manual also instructs Win31 users to * select 'BJ10e' as their driver, so presumably the margins will be
#define LINE_SIZE ((X_DPI * 84 / 10 + 7) / 8) /* bytes per line for letter */ static int md50_print_page(gx_device_printer *, FILE *, const char *, int); static dev_proc_open_device(md_open); static dev_proc_print_page(md50m_print_page); static dev_proc_print_page(md50e_print_page); static dev_proc_print_page(md1xm_print_page); static gx_device_procs prn_md_procs = prn_procs(md_open, gdev_prn_output_page, gdev_prn_close); gx_device_printer far_data gs_md50Mono_device = prn_device(prn_md_procs, "md50Mono", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 600, /* x_dpi */ 600, /* y_dpi */ 0, 0, 0, 0, /* margins */ 1, md50m_print_page); gx_device_printer far_data gs_md50Eco_device = prn_device(prn_md_procs, "md50Eco", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 600, /* x_dpi */ 600, /* y_dpi */ 0, 0, 0, 0, /* margins */ 1, md50e_print_page); gx_device_printer far_data gs_md1xMono_device = prn_device(prn_md_procs, "md1xMono",
/* $Id: gdev8510.c,v 1.9 2008/03/23 15:28:04 Arabidopsis Exp $*/ /* * C.Itoh M8510 printer driver for ghostscript. * * By Bob Smith <*****@*****.**> */ #include "gdevprn.h" /* The device descriptor */ static dev_proc_print_page(m8510_print_page); const gx_device_printer far_data gs_m8510_device = prn_device(prn_std_procs, "m8510", 85, /* width_10ths, 8.5" */ 110, /* height_10ths, 11" */ 160, /* x_dpi */ 144, /* y_dpi */ 0,0,0.5,0, /* left, bottom, right, and top margins */ 1, m8510_print_page); /* ------ forward declarations ------ */ static void m8510_output_run(gx_device_printer *pdev, byte *out, int pass, FILE *prn_stream); /* ------ internal routines ------ */ /* Send the page to the printer. */ static int m8510_print_page(gx_device_printer *pdev, FILE *prn_stream) {
/* Default X and Y resolution. */ #ifndef X_DPI # define X_DPI 72 #endif #ifndef Y_DPI # define Y_DPI 72 #endif static dev_proc_print_page(jbig2_print_page); /* Monochrome only */ const gx_device_printer gs_gdevjbig2_device = prn_device(prn_std_procs, "jbig2", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, /* resolution */ 0, 0, 0, 0, /* margins */ 1, jbig2_print_page); /* Send the page to the file. */ static int jbig2_print_page(gx_device_printer * pdev, FILE * prn_stream) { gx_device_jbig2 *jdev = (gx_device_jbig2 *) pdev; gs_memory_t *mem = jdev->memory; int line_size = gdev_mem_bytes_per_scan_line((gx_device *) pdev); byte *in = gs_alloc_bytes(mem, line_size, "jbig2_print_page(in)"); byte *fbuf = 0; uint fbuf_size; byte *jbuf = 0; uint jbuf_size;
static dev_proc_print_page(imagen_print_page); static dev_proc_open_device(imagen_prn_open); static dev_proc_close_device(imagen_prn_close); /* Since the print_page doesn't alter the device, this device can print in the background */ gx_device_procs imagen_procs = prn_procs(imagen_prn_open, gdev_prn_bg_output_page, imagen_prn_close); #define ppdev ((gx_device_printer *)pdev) /*-------------------------------------------*/ const gx_device_printer far_data gs_imagen_device = prn_device(/*prn_std_procs*/ imagen_procs, "imagen", WIDTH_10THS, HEIGHT_10THS, MAX_DPI, /* x_dpi */ MAX_DPI, /* y_dpi */ MARG_L,MARG_R,MARG_T,MARG_B, /* margins */ 1, imagen_print_page); /*-------------------------------------------*/ /*-------------------------------------------*/ static void iWrite(FILE *Out, byte Val) { /* iWrite */ const char *hexList = "0123456789ABCDEF"; /* if we are doing byte-stream, quote characters that would otherwise match EOF and QUOTE itself, or other special chars */ /* Imagen quoting takes one character and writes out the QUOTE
#include "gdevprn.h" /* Define the device parameters. */ #ifndef X_DPI # define X_DPI 72 #endif #ifndef Y_DPI # define Y_DPI 72 #endif /* The device descriptor */ private dev_proc_print_page(cif_print_page); const gx_device_printer far_data gs_cif_device = prn_device(prn_std_procs, "cif", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0,0,0,0, 1, cif_print_page); /* Send the page to the output. */ private int cif_print_page(gx_device_printer *pdev, FILE *prn_stream) { int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev); int lnum; byte *in = (byte *)gs_malloc(pdev->memory, line_size, 1, "cif_print_page(in)"); char *s; int scanline, scanbyte; int length, start; /* length is the number of successive 1 bits, */ /* start is the set of 1 bit start position */ if (in == 0)
/* Shift the origin from the top left corner of the pysical page to the first printable pixel, as defined by the top and left margins. */ /* modified from gdevsppr.c. */ static void fmlbp_get_initial_matrix(gx_device *dev, gs_matrix *pmat) { gx_default_get_initial_matrix(dev, pmat); pmat->tx -= (dev->l_margin * dev->x_pixels_per_inch); pmat->ty -= (dev->t_margin * dev->y_pixels_per_inch); } #endif/*FMLBP_NOADJUST_MARGIN*/ gx_device_printer gs_fmlbp_device = prn_device(PRNFMLBP, "fmlbp", DEFAULT_WIDTH_10THS_A4, /* width_10ths, 8.3" */ DEFAULT_HEIGHT_10THS_A4, /* height_10ths, 11.7" */ X_DPI, Y_DPI, 0.20, 0.35, 0.21, 0.20, /* left,bottom,right,top margins */ 1, fmlbp_print_page); /* ------ Internal routines ------ */ #define ESC 0x1b #define CEX 0x1c #define CSI 0x1b,0x5b #define PU1 0x1b,0x51 static char can_inits[] ={ ESC, 'c', /* Software reset */ #ifdef OLD_FMLBP_400DPI PU1, '4', '0', '0', '!', 'A' /* 400dpi */ /*PU1, '0', ';','4', ';','0', ';','0','!','@' */ /* landscape */ #endif/*OLD_FMLBP_400DPI*/
/* gdevbj10.c */ /* Canon Bubble Jet BJ-10e printer driver for Ghostscript */ #include "gdevprn.h" /* * The only available resolutions are (180,360)x(180,360). */ /* The device descriptor */ private dev_proc_print_page(bj10e_print_page); gx_device_printer gs_bj10e_device = prn_device(prn_std_procs, "bj10e", 80, /* width_10ths, 8" */ 105, /* height_10ths, 10.5" */ 360, /* x_dpi */ 360, /* y_dpi */ 0,0,0,0, /* margins */ 1, bj10e_print_page); /* ------ internal routines ------ */ /* Send the page to the printer. */ private int bj10e_print_page(gx_device_printer *pdev, FILE *prn_stream) { int line_size = gx_device_bytes_per_scan_line((gx_device *)pdev, 1); int xres = pdev->x_pixels_per_inch; int yres = pdev->y_pixels_per_inch; int mode = (yres == 180 ? (xres == 180 ? 11 : 12) : (xres == 180 ? 14 : 16));