示例#1
0
文件: pcpage.c 项目: hackqiang/gs
/*
 * ESC & l <feed_enum> H
 *
 * Set paper source
 */
static int
set_paper_source(pcl_args_t * pargs, pcl_state_t * pcs)
{
    uint i = uint_arg(pargs);
    /* oddly the command goes to the next page irrespective of
       arguments */
    int code = pcl_end_page_if_marked(pcs);

    if (code < 0)
        return code;
    pcl_home_cursor(pcs);
    /* Do not change the page side if the wanted paper source is the same as the actual one */
    if (pcs->paper_source != i) {
        pcs->back_side = false;
        put_param1_bool(pcs, "FirstSide", !pcs->back_side);
    }
    pcs->paper_source = i;
    /* Note: not all printers support all possible values. */
    if (i <= 6) {
        code = 0;
        if (i > 0)
            code = put_param1_int(pcs, "%MediaSource", i);
        return (code < 0 ? code : 0);
    } else
        return e_Range;
}
示例#2
0
static int /* ESC & l <bin_enum> G */
pcl_output_bin_selection(pcl_args_t *pargs, pcl_state_t *pcs)
{	uint i = uint_arg(pargs);
	if ( i < 1 || i > 2 )
	  return e_Range;
	return put_param1_int(pcs, "OutputBin", i);
}
示例#3
0
static int /* ESC & l <num_copies> X */
pcl_number_of_copies(pcl_args_t *pargs, pcl_state_t *pcs)
{	int i = int_arg(pargs);
	if ( i < 1 )
	  return 0;
	pcs->num_copies = i;
	return put_param1_int(pcs, "NumCopies", i);
}
示例#4
0
/*
 * ESC & l <feed_enum> H
 *
 * Set paper source
 */
  static int
set_paper_source(
    pcl_args_t *    pargs,
    pcl_state_t *   pcs
)
{
    uint            i = uint_arg(pargs);

    /* oddly the command goes to the next page irrespective of
       arguments */
    int code = pcl_end_page_if_marked(pcs);
    if ( code < 0 )
        return code;
    pcl_home_cursor(pcs);

    /* Note: not all printers support all possible values. */
    if (i <= 6) {
        code = 0;
        if (i > 0)
            code = put_param1_int(pcs, "%MediaSource", i);
        return (code < 0 ? code : 0);
    } else
        return e_Range;
}