diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2023-02-16 14:20:02 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2023-02-17 09:14:57 +0000 |
commit | 64d781de9217ba726b9047c81e4783625e619a02 (patch) | |
tree | abe7ab4f411a900da128a4318a8022402361d3e4 /contrib | |
parent | 37c28d47e57e74874125345986b3f465d97f3b61 (diff) | |
download | ghostpdl-64d781de9217ba726b9047c81e4783625e619a02.tar.gz |
Epson ESC device - add fuzzy matching for media sizes
Bug #706367 "ESC/Page driver does not set page size correctly"
The PLRM indicates (Table 6.2, page 401, PageSize) that page dimensions
are considered to match if they are within a tolerance of 5 units in
each direction. This device (like others) was insisting on a precise
match.
Just add the tolerance.
I have no way to test this, other than looking at the content of the
output from the device, written to file, which appears to be correct.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/japanese/gdevespg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/japanese/gdevespg.c b/contrib/japanese/gdevespg.c index 4ce7b718c..2b160f7d8 100644 --- a/contrib/japanese/gdevespg.c +++ b/contrib/japanese/gdevespg.c @@ -305,9 +305,11 @@ escpage_paper_set(gx_device_printer * pdev, gp_file * fp) hp = (int)(width / 72.0 * pdev->x_pixels_per_inch); } - for (pt = epagPaperTable; pt->escpage > 0; pt++) - if (pt->width == w && pt->height == h) + for (pt = epagPaperTable; pt->escpage > 0; pt++) { + if (w >= pt->width - 5 && w <= pt->width + 5 && + h >= pt->height - 5 && h <= pt->height + 5) break; + } gp_fprintf(fp, "%c%d", GS, pt->escpage); if (pt->escpage < 0) |