Fix for Bug 687255 pcl output shifted to bottom of page
"Dan Coby" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Fix for Bug 687255 pcl output shifted to bottom of page. Correct
the order of the PCL commands at the start of page for the ljet devices.
DETAILS:
This problem surfaced when a previous fix 686815 was made. That fix
corrected a line of code which was setting the page seize in the output
file. That fix, which consists of a single character change, was:
Index: gdevdljm.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevdljm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gdevdljm.c 7 Oct 2002 08:28:56 -0000 1.8
+++ gdevdljm.c 30 Oct 2003 06:34:05 -0000 1.9
@@ -144,7 +144,7 @@
fputs(page_init, prn_stream);
fprintf(prn_stream, "\033&l%dX", num_copies); /* # of copies */
if (features & PCL_CAN_SET_PAPER_SIZE){
- fprintf(prn_stream, "\033&|%dA", paper_size);
+ fprintf(prn_stream, "\033&l%dA", paper_size);
}
/* End raster graphics, position cursor at top. */
With the correct page size being specified in the output file, there were
some side effects. Setting the page size resets several other items,
including the starting page X and Y offsets.
The fix for this problem consists of simply moving the setting of the page
size three lines earlier in the file. Now the page size is set prior to
the page X and Y offsets, which are set as part of this line:
fputs(page_init, prn_stream);
The fix is:
Index: src/gdevdljm.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevdljm.c,v
retrieving revision 1.9
diff -u -r1.9 gdevdljm.c
--- src/gdevdljm.c 30 Oct 2003 06:34:05 -0000 1.9
+++ src/gdevdljm.c 24 Jan 2004 07:35:10 -0000
@@ -140,12 +140,12 @@
}
}
/* Put out per-page initialization. */
- fputs("\033&l0o0l0E", prn_stream);
- fputs(page_init, prn_stream);
- fprintf(prn_stream, "\033&l%dX", num_copies); /* # of copies */
if (features & PCL_CAN_SET_PAPER_SIZE){
fprintf(prn_stream, "\033&l%dA", paper_size);
}
+ fputs("\033&l0o0l0E", prn_stream);
+ fputs(page_init, prn_stream);
+ fprintf(prn_stream, "\033&l%dX", num_copies); /* # of copies */
/* End raster graphics, position cursor at top. */
fputs("\033*rB\033*p0x0Y", prn_stream);
A final note: The page size is also set at the start of the output file.
This is extremely likely to be redundant however I am not removing this
since it has not created a problem to date and removing it has a small
chance of creating a problem. (I.e. don't fix it if it is not broke.)
Dan