aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/page
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2019-02-25 09:45:53 -0500
committerRuss Cox <rsc@swtch.com>2019-02-25 09:45:53 -0500
commit047fd921744f39a82a86d9370e03f7af511e6e84 (patch)
tree3e8b054cc13668bfb7e230fd1ade8dd847cd4013 /src/cmd/page
parent3ad4afbe821687bd77f8dffb0e0bf4947faf0a83 (diff)
downloadplan9port-047fd921744f39a82a86d9370e03f7af511e6e84.tar.gz
plan9port-047fd921744f39a82a86d9370e03f7af511e6e84.tar.bz2
plan9port-047fd921744f39a82a86d9370e03f7af511e6e84.zip
page: handle EPS without showpage
Diffstat (limited to 'src/cmd/page')
-rw-r--r--src/cmd/page/gs.c4
-rw-r--r--src/cmd/page/ps.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/page/gs.c b/src/cmd/page/gs.c
index 7179429a..5c493b35 100644
--- a/src/cmd/page/gs.c
+++ b/src/cmd/page/gs.c
@@ -186,6 +186,10 @@ spawngs(GSInfo *g, char *safer)
Binit(&g->gsrd, stdoutp[0], OREAD);
+ gscmd(g, "/PAGEDIDSHOWPAGE false def\n");
+ gscmd(g, "/showpage { /PAGEDIDSHOWPAGE true def showpage } bind def\n");
+ gscmd(g, "/PAGEFLUSH { PAGEDIDSHOWPAGE not {showpage} if /PAGEDIDSHOWPAGE false def } def\n");
+
gscmd(g, "/PAGEOUT (/dev/fd/4) (w) file def\n");
if(!strcmp(safer, "-dSAFER"))
gscmd(g, ".setsafe\n");
diff --git a/src/cmd/page/ps.c b/src/cmd/page/ps.c
index e75a1477..7935f694 100644
--- a/src/cmd/page/ps.c
+++ b/src/cmd/page/ps.c
@@ -353,7 +353,7 @@ Keepreading:
}
if(dumb) {
- fprint(ps->gs.gsfd, "(%s) run\n", argv[0]);
+ fprint(ps->gs.gsfd, "(%s) run PAGEFLUSH\n", argv[0]);
fprint(ps->gs.gsfd, "(/dev/fd/3) (w) file dup (THIS IS NOT A PLAN9 BITMAP 01234567890123456789012345678901234567890123456789\\n) writestring flushfile\n");
}
@@ -420,6 +420,7 @@ psdrawpage(Document *d, int page)
* so send one to avoid deadlock.
*/
write(ps->gs.gsfd, "\n", 1);
+ fprint(ps->gs.gsfd, "\nPAGEFLUSH\n");
im = convert(&ps->gs.g);
if(im == nil) {
fprint(2, "fatal: readimage error %r\n");