Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input/Output File functions in Postscript

Status
Not open for further replies.

anuc2000

Programmer
Nov 10, 2000
26
US
Hi
I want help with file functions in Postscript Programing
I'd appreciate any pointers as to where I can get examples of these functions/operators.
TIA
anu_c_2000
 
The file command is to easy. Is take a a string(Name of file) and the acces mode a string (r) read (w) write (rw) read/write (a) append. This two string is on the stack in order the filename and after the acces mode and the command file put your a value of file type on the stack. With this value you can make read and write for the acces mode you set.


Eric Riendeau
Developper
Pirel inc.
email : eriendeau@pirel.com
 
Thanks Eric
I got the file operators syntax and tried it
but I could not understand how it works.
That is the reason I wanted examples.
What I am looking to do is to have a basic form (PS File) on a printer and
to be able to feed it variable data like addresses and names from a flat file
while pulling in graphics according to the name
Any help is appreciated
Thank You
anuc2000
 
Did you ever find how to do this?
I am facedwith a very similar problem.

Mark
 
Ok if you have the file he as that
// file : name.txt
// BOF **********
John McHatie
Eric Riendeau
Jean Chretien
// EOF *********

now i want to read line by line i cant use that function
// PS file *********
%!PS-Adobe
/PosY 790 def
/PosX 50 def
/Courrier findfont %OS= font
12 scalefont setfont %OS=-
(name.txt) (r) file %OS= file
{ %OS= file
dup 250 string readline %OS= file string bool
%if the boolean is false you take EOF
{ %If you take true %OS= file string
PosX PosY moveto %OS= file string
show %OS= file
/PosY PosY 20 sub def %OS= file
}
{ %If you take the eof %OS= file string
PosX PosY moveto %OS= file
show %OS= file
exit %OS= file
}ifelse
%OS= file

} loop
%OS= file
closefile %OS= file

// **************
That program show the list of name
It not manage the end of page

Eric Riendeau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top