diff --git a/contrib/japanese/gdev10v.c b/contrib/japanese/gdev10v.c index 510a74e870762240453b8f44a10b4936f05edcbc..5b617978f0761ba6354894dfdb62097a43f260a9 100644 --- a/contrib/japanese/gdev10v.c +++ b/contrib/japanese/gdev10v.c @@ -68,13 +68,25 @@ static dev_proc_print_page(bj10v_print_page); static dev_proc_get_initial_matrix(bj10v_get_initial_matrix); #endif +static int +bj10v_open(gx_device * pdev) +{ + if (pdev->HWResolution[0] < 180 || + pdev->HWResolution[1] < 180) + { + emprintf(pdev->memory, "device requires a resolution of at least 180dpi\n"); + return_error(gs_error_rangecheck); + } + return gdev_prn_open(pdev); +} + #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); + prn_procs(bj10v_open, gdev_prn_output_page, gdev_prn_close); gx_device_printer gs_bj10v_device = prn_device(prn_bj10v_procs, "bj10v", diff --git a/contrib/japanese/gdevalps.c b/contrib/japanese/gdevalps.c index e6af9cf1694b23704323503dcf1d6e4f0900f18f..c52c4b03b3fee814a4620dee197c4f6508296831 100644 --- a/contrib/japanese/gdevalps.c +++ b/contrib/japanese/gdevalps.c @@ -156,12 +156,19 @@ static int md_open(gx_device *pdev) { static const float md_margins[4] = - { MD_SIDE_MARGIN, MD_BOTTOM_MARGIN, + { + MD_SIDE_MARGIN, MD_BOTTOM_MARGIN, MD_SIDE_MARGIN, MD_TOP_MARGIN - }; + }; - gx_device_set_margins(pdev, md_margins, true); - return gdev_prn_open(pdev); + if (pdev->HWResolution[0] != 600) + { + emprintf(pdev->memory, "device must have an X resolution of 600dpi\n"); + return_error(gs_error_rangecheck); + } + + gx_device_set_margins(pdev, md_margins, true); + return gdev_prn_open(pdev); } /* MD5000 monochrome mode entrance. */