summaryrefslogtreecommitdiff
path: root/src/main/escp2-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/escp2-driver.c')
-rw-r--r--src/main/escp2-driver.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/src/main/escp2-driver.c b/src/main/escp2-driver.c
index 24ef1c1..2141cfc 100644
--- a/src/main/escp2-driver.c
+++ b/src/main/escp2-driver.c
@@ -1,5 +1,5 @@
/*
- * "$Id: escp2-driver.c,v 1.30 2006/07/22 20:28:13 rlk Exp $"
+ * "$Id: escp2-driver.c,v 1.30.6.1 2007/03/02 12:01:25 rlk Exp $"
*
* Print plug-in EPSON ESC/P2 driver for the GIMP.
*
@@ -114,6 +114,7 @@ print_debug_params(stp_vars_t *v)
print_remote_int_param(v, "Page_height", pd->page_height);
print_remote_int_param(v, "Page_true_height", pd->page_true_height);
print_remote_int_param(v, "Page_extra_height", pd->page_extra_height);
+ print_remote_int_param(v, "Paper_extra_bottom", pd->paper_extra_bottom);
print_remote_int_param(v, "Image_left", pd->image_left);
print_remote_int_param(v, "Image_top", pd->image_top);
print_remote_int_param(v, "Image_width", pd->image_width);
@@ -240,22 +241,12 @@ escp2_set_remote_sequence(stp_vars_t *v)
stp_send_command(v, "SN", "bccc", 0, 0, feed_sequence);
if (stp_get_boolean_parameter(v, "FullBleed"))
{
- stp_send_command(v, "FP", "bch", 0, 0xffb0);
-#if 0
- /* These commands do not appear to do anything on the */
- /* 2200. Need to test on R800. */
- /* From the R1800 manual -- bottom margin borderless */
- stp_send_command(v, "PM", "bcc", 0, 0);
- stp_send_command(v, "DP", "bcc", 0, 0);
- stp_send_command(v, "SN", "bc", 0);
- stp_send_command(v, "MI", "bccc", 1, 0xb, 1);
- stp_send_command(v, "US", "bccc", 0, 0, 2);
- stp_send_command(v, "US", "bccc", 0, 1, 0);
- /* This command means "check paper size - no" */
- stp_send_command(v, "US", "bccc", 0, 2, 0);
- stp_send_command(v, "DR", "bcccc", 0, 0, 0, 0);
- stp_send_command(v, "PP", "bccc", 0, 1, 0xff);
-#endif
+ stp_send_command(v, "FP", "bch", 0,
+ (unsigned short) -pd->zero_margin_offset);
+ if (pd->borderless_sequence)
+ stp_zfwrite(pd->borderless_sequence->data,
+ pd->borderless_sequence->bytes,
+ 1, v);
}
}
if (pd->input_slot)
@@ -387,7 +378,8 @@ static void
escp2_set_page_height(stp_vars_t *v)
{
escp2_privdata_t *pd = get_privdata(v);
- int l = pd->page_management_units * pd->page_true_height / 72;
+ int l = (pd->page_true_height + pd->paper_extra_bottom) *
+ pd->page_management_units / 72;
if (pd->use_extended_commands)
stp_send_command(v, "\033(C", "bl", l);
else
@@ -402,6 +394,8 @@ escp2_set_margins(stp_vars_t *v)
int top = pd->page_management_units * pd->page_top / 72;
top += pd->initial_vertical_offset;
+ top -= pd->page_extra_height;
+ bot += pd->page_extra_height;
if (pd->use_extended_commands &&
(pd->command_set == MODEL_COMMAND_2000 ||
pd->command_set == MODEL_COMMAND_PRO))
@@ -411,21 +405,14 @@ escp2_set_margins(stp_vars_t *v)
}
static void
-escp2_set_form_factor(stp_vars_t *v)
+escp2_set_paper_dimensions(stp_vars_t *v)
{
escp2_privdata_t *pd = get_privdata(v);
if (pd->advanced_command_set)
{
- int w = pd->page_width * pd->page_management_units / 72;
- int h = (pd->page_true_height + pd->page_extra_height) *
+ int w = pd->page_true_width * pd->page_management_units / 72;
+ int h = (pd->page_true_height + pd->paper_extra_bottom) *
pd->page_management_units / 72;
-
- if (stp_get_boolean_parameter(v, "FullBleed"))
- /* Make the page 160/360" wider for full bleed printing. */
- /* Per the Epson manual, the margin should be expanded by 80/360" */
- /* so we need to do this on the left and the right */
- w += 320 * pd->page_management_units / 720;
-
stp_send_command(v, "\033(S", "bll", w, h);
}
}
@@ -599,7 +586,7 @@ stpi_escp2_init_printer(stp_vars_t *v)
escp2_set_printhead_resolution(v);
escp2_set_page_height(v);
escp2_set_margins(v);
- escp2_set_form_factor(v);
+ escp2_set_paper_dimensions(v);
}
void