Creating a PostScript File

Hi All,
I have a requirement, where i have create a pdf file in unix. I have gone through few links and understood that it could be done in 2 step manner.

  • Create a .ps PostScript file.
  • Pass .ps file to p2pdf command to create the pdf.

But i am having trouble creating the .ps file. I have learned that a2ps is the command to create it.
But in my setup, the shell does nt recognize the a2ps command, but it does have a man page.
Not sure what i am missing here, can someone please let me know what the problem is?

Also is there a better way to create a pdf file in unix.

Thank you in advance,

Regards,
Abhishek S.

a2ps is not "the" postscript command, just a postscript command.

Postscript is just text, with carriage-return newline. You can write it by hand if you really want to. (from math-696)

cat <<EOF | sed 's/$/\r/' > myfile.ps
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 135 110
/Helvetica findfont 60 scalefont setfont
/print696 {0 0 moveto (696) show} def
.90 -.03 .10 
{dup 1 exch sub 0 setrgbcolor print696
            2 .5 translate 1 rotate  } for
0 0 1.0 setrgbcolor print696
showpage
EOF

Our office printer was willing to print it, it shows '696' in rotated text in one corner, so it's valid postscript...

Hi Corona,
Thanks for the prompt response, but the requirement here i have to convert the any file into .pdf file in unix.

Am not sure, how effective it is generate the pdf with the post script file.
I ll def try out the solution, but is there any better way that we could generate pdf in unix. ?

If you don't have a2ps, you could try installing it.