🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #534

Help on a PostScript problem

#534
From: Larry Edwards
Date: Wed, 15 Apr 1992 18:00
50 lines
1834 bytes
Anybody know how to test for the presence of data and, if absent, not print  
further?

I wrote a two page PostScript form which is "filled in" by a program; but  
normally I don't want the second page to print out unless there are data in it.   
So I want to test for the presence of data before printing the second page.  If  
I do not find data, I want to exit the printing entirely.  
I have tried to use exit, stop, and quit; but I end up hanging the process.

Below is what I tried unsuccessfully.  If there is a "t" in the parentheses in  
front of PI_OS_TYPE__PII,OS6, then it is ok.  

Any ideas?
Larry Edwards

%!PS-Adobe-2.1
 . .
%%Pages: 2
 . .
%%EndSetup
%%Page: 1 1
 . .
% Draw the lines.
0.3 setlinewidth
0 cm height width hLine
 . .
/PI_OS_TYPE__PII,OS1 { /ymark Section1Top 0.50 cm sub def
dup (t) search { pop pop pop 15.35 cm ymark xSquareBox }  { pop } ifelse
    (T) search { pop pop pop 15.35 cm ymark xSquareBox }  { pop } ifelse
} def
 . .
(t)PI_OS_TYPE__PII,OS1
 . .
showpage
%%Page: 2 2
0 cm height width hLine
/PI_OS_TYPE__PII,OS6  
{  dup stringwidth pop   0  ne
{ /ymark Section1Top 0.50 cm sub def
dup (t) search { pop pop pop 15.35 cm ymark xSquareBox }  { pop } ifelse
    (T) search { pop pop pop 15.35 cm ymark xSquareBox }  { pop } ifelse } 
{quit } ifelse
} 
def
 . .
()PI_OS_TYPE__PII,OS6
 . .
showpage
%%Trailer
end
Technical Details
Message-ID: <1992Apr15.180018.23019@n1.nsf.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!mips!darwin.sura.net!n1!news

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!mips!darwin.sura.net!n1!news
From: ledwards@nsf.gov (Larry Edwards)
Subject: Help on a PostScript problem
Message-ID: <1992Apr15.180018.23019@n1.nsf.gov>
Keywords: PostScript, forms
Sender: news@n1.nsf.gov
Reply-To: ledwards@nsf.gov
Organization: National Science Foundation
Distribution: us
Date: Wed, 15 Apr 1992 18:00:18 GMT
Lines: 50