1: Allow /env/pageppi to set the default PPI for PS and PDF documents. 2: Don't abort if a non-default PPI is specified for graphics files. Just ignore the setting; it's documented to only apply to PS and PDF, anyway. Reference: /n/sources/patch/maybe/page-env-ppi Date: Thu Oct 29 19:11:48 CET 2009 Signed-off-by: lyndon@orthanc.ca --- /sys/src/cmd/page/page.c Thu Oct 29 19:08:38 2009 +++ /sys/src/cmd/page/page.c Thu Oct 29 19:08:36 2009 @@ -82,6 +82,11 @@ enum { Ninput = 16 }; uchar buf[Ninput+1]; int readstdin; + char *envppi; + + envppi = getenv("pageppi"); + if(envppi != nil) + ppi = atoi(envppi); ARGBEGIN{ /* "temporary" debugging options */ @@ -197,10 +202,6 @@ else if(strncmp((char*)buf, "x T ", 4) == 0) doc = inittroff(b, argc, argv, buf, Ninput); else { - if(ppi != 100) { - fprint(2, "page: you can't specify -p with graphic files\n"); - wexits("-p and graphics"); - } doc = initgfx(b, argc, argv, buf, Ninput); } --- /sys/man/1/page Thu Oct 29 19:08:42 2009 +++ /sys/man/1/page Thu Oct 29 19:08:40 2009 @@ -75,7 +75,8 @@ .B -p option sets the resolution for PostScript and PDF files, in pixels per inch. -The default is 100 ppi. +The default is 100 ppi, or the value of +.BR $pageppi . The .B -r option reverses the order in which pages are displayed.