%! % string.ps - Don Yang (uguu.org) % % Test string functions and printer compatibility. % % On the one system and printer that I tried, I was able to get this % to print with simply "lpr", despite this file lacking all DSC % comments, so I guess those are mostly optional. For reference, I % was running CUPS 1.3.7, and the printer was Canon imageRUNNER 5570. % Your mileage may vary. /StripSpaces { 1024 string 0 % x out offset 3 2 roll % out offset x { token { % newstring offset x token 32 string cvs % out offset x (token) dup length % out offset x (token) length(token) 4 index % out offset x (token) length(token) out 4 index % out offset x (token) length(token) out offset 4 3 roll % out offset x length(token) out offset (token) putinterval % out offset x length(token) 3 2 roll % out x length(token) offset add exch % out offset x } { % newstring offset exit } ifelse } loop % newstring offset 0 exch getinterval % truncate(out) } bind def /StripAndExec { StripSpaces cvn cvx exec } bind def 72 72 (m o v e t o) StripAndExec 468 0 (rli\tneto) StripAndExec 0 648 (r lineto) StripAndExec -468 0 ( rline to ) StripAndExec (close path) StripAndExec (stroke) StripAndExec (showp age) StripAndExec