For reasons unknown to me, some xmgrace pre-compiled binaries don't come with the "print to PDF" option (Ubuntu's binary is one example). In this case you either re-compile xmgrace (enabling the PDF output) or use a combination of commands to generate an eps and then convert it to pdf. This is what I use (with a Linux distro):
f=my_file
base=${f%.*}
LANG= xmgrace -hardcopy -hdevice EPS $f -printfile $base.eps
epstopdf $base.eps --outfile=$base.pdf
rm $base.eps
The LANG=
is there to avoid localisation issues (with some locales the comma is used in place of the dot as decimal separator and I don't want that).
If you don't have epstopdf
installed you can use any other software to do the conversion.