summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-08-20 18:09:46 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-08-20 18:20:21 +0100
commitc5adcd5d12f9576e562506cd3f5fb1d03d2a6158 (patch)
tree833bc592243c25a6876f0f98687b0fe1cff1112c /pcl
parent4a590c691e15b2c06cd4b0c35a41833d225aafd5 (diff)
downloadghostpdl-c5adcd5d12f9576e562506cd3f5fb1d03d2a6158.tar.gz
PCL: Update windows call sequence to match linux.
Linux sends a UEL at the end of a job, windows does not. This causes files that end in (for example): <UEL>@PJL LPORTROTATE (with no trailing return) to give an error. Windows and linux now behave the same.
Diffstat (limited to 'pcl')
-rw-r--r--pcl/pl/plwmainc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pcl/pl/plwmainc.c b/pcl/pl/plwmainc.c
index f66fed09e..cdac9d167 100644
--- a/pcl/pl/plwmainc.c
+++ b/pcl/pl/plwmainc.c
@@ -30,6 +30,8 @@
#include "plwimg.h"
#include "plapi.h"
+#define PJL_UEL "\033%-12345X"
+
#if 0
/* FIXME: this is purely because the gsdll.h requires psi/iapi.h and
* we don't want that required here. But as a couple of Windows specific
@@ -341,6 +343,8 @@ main_utf8(int argc, char *argv[])
char **nargv;
char dformat[64];
char ddpi[64];
+ size_t uel_len = strlen(PJL_UEL);
+ int dummy;
/* Mark us as being 'system dpi aware' to avoid horrid scaling */
avoid_windows_scale();
@@ -421,6 +425,14 @@ main_utf8(int argc, char *argv[])
memcpy(&nargv[3], &argv[1], argc * sizeof(char *));
#endif
code = gsapi_init_with_args(instance, nargc, nargv);
+ if (code >= 0)
+ code = gsapi_run_string_begin(instance, 0, &dummy);
+ if (code >= 0)
+ code = gsapi_run_string_continue(instance, PJL_UEL, uel_len, 0, &dummy);
+ if (code >= 0)
+ code = gsapi_run_string_end(instance, 0, &dummy);
+ if (code == gs_error_InterpreterExit)
+ code = 0;
code1 = gsapi_exit(instance);
if (code == 0 || (code == gs_error_Quit && code1 != 0))
code = code1;