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
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.