Summary: | Resolution setting in the pxlmono/pxlcolor drivers does not work | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Till Kamppeter <till.kamppeter> |
Component: | Printer Driver | Assignee: | Ray Johnston <ray.johnston> |
Status: | NOTIFIED FIXED | ||
Severity: | normal | CC: | ralph.giles |
Priority: | P4 | ||
Version: | master | ||
Hardware: | All | ||
OS: | All | ||
Customer: | Word Size: | --- | |
Attachments: | Patch to let pxlmono/pxlcolor drivers insert PJL code for the resolution |
Description
Till Kamppeter
2007-05-11 09:00:01 UTC
Created attachment 2955 [details]
Patch to let pxlmono/pxlcolor drivers insert PJL code for the resolution
Some additional note: The merger with ESP Ghostscript is in the trunk now and the branch is removed. So take the trunk and the cups/ files from there for further investigations now. Patch looks ok to me. The pxl drivers are high level vector devices, not raster devices. I don't believe it appropriate to mix setpagedevice parameters in the stream for a single job. For example, pxl sets the resolution at the beginning of a job and maintains that setting for all pages. If changing resolutions is necessary a new job must be created. Unfortunately that could result in losing state (downloaded fonts, color settings). These devices could be written like the raster devices, they would require one job (Session in XL terminology) per page but then you would lose a lot performance-wise. In short you have to use the -r option. Or you can experiment using startjob or exitserver to set options in advance. Ray can help you with that if you go that route. Reassign it back to me if you want me to study it more. So then I think the way to solve it is to apply my patch and to update the documentation telling that the PostScript command insertion <</HWResolution[XRES YRES]>>setpagedevice is not valid for this driver and "-rXRESxYRES" is required to print with resolutions other than 600 dpi. To make it even better, the driver should ignore <</HWResolution[XRES YRES]>>setpagedevice commands. If there are other high-level vector drivers with a similar problem, their documentation should get fixed appropriately. I have applied the patch to the SVN repositories now. So only the documentation needs to get fixed now. One thing I do not understand about this patch, is that HWResolution _was_ being used in the PXL output to set the UnitsPerMeasure values. The output from ghostpdl tools/pxl/pxldis.py shows: ` HP-PCL XL;1;1 uint16_xy 600 600 UnitsPerMeasure ubyte 0 Measure // eInch=0 ubyte 3 ErrorReport // eBackChAndErrPage=3 // Op Pos: 1 Op fOff: 140 Op Hex: 41 Level: 0 BeginSession Specifying resolution in PJL doesn't hurt, but I don't quite follow why the UnitsPerMeasure attribute for 'BeginSession' wasn't adequate. Ray, tests with actual printers show that the PJL command is required. Without the command the printer stays on 600 dpi. I have found a small bug in my patch, which I have fixed in the SVN now: Modified: trunk/gs/base/gdevpxut.c =================================================================== --- trunk/gs/base/gdevpxut.c 2008-09-02 09:06:41 UTC (rev 9060) +++ trunk/gs/base/gdevpxut.c 2008-09-02 18:37:07 UTC (rev 9061) @@ -81,7 +81,7 @@ else px_put_bytes(s, (const byte *)resolution_600, strlen(resolution_600)); - if ((uint) (dev->HWResolution[0] + 0.5) != + if ((uint) (dev->HWResolution[1] + 0.5) != (uint) (dev->HWResolution[0] + 0.5)) { px_put_bytes(s, (const byte *)"x", strlen("x")); if ((uint) (dev->HWResolution[1] + 0.5) == 150) |