I'm trying to convert a .ps file made with xmgrace
(it's a curve of data as you can guess) but when I convert using ImageMagick
via the convert command or ps2pdf
with the options -format a4 or -sPAPERSIZE=a4 I end up with the same problem.
Actually the image ends up in the top left corner of my .pdf file while almost 3/4 of the page stays blank. I would like to resize it so it takes the whole page.
In the print setup of xmgrace, I used both the A4 format and a custom default I had 2262x1729 pix
and both ended up with the same result.
The header of the .ps file is as follow:
%!PS-Adobe-3.0
%%BoundingBox: 0 0 415 543
%%LanguageLevel: 2
%%Creator: Grace-5.1.22
%%CreationDate: Wed Dec 9 13:21:52 2015
%%DocumentData: Clean8Bit
%%Orientation: Landscape
%%Pages: 1
I saw that touching the bounding box limits could be a way but it seems risky and doesn't solve the problem as I'll have to do it with every single file... Our machines runs on RedHat and actually, my supervisor (compiling and using the same machine) has no problem like mine and can't tell me why.
I suspect my terminal settings to be part of the problem but I'm not sure.
EDIT: Thank you KenS for the answer. I actually managed to use gs to solve my problem regarding the output i got but I also found that using .eps outputs from xmgrace and epstopdf (instead of .ps and ps2pdf as my supervisor does) also solves the problem in an other way. .ps outputs from xmgrace are tricky to use due to (in my initial guess) terminal configuration so I guess I won't use them again.
You need to specify (to Ghostscript) -dEPSFitPage or you need to have your output request a media size (you don't say if it does, and you don't post most of the program so I can't tell).
Altering the BoundingBox comments will do nothing useful. Either the PostScript interpreter will do nothing with them (which is permitted, they are comments) or it will use them to set the page size, but since you haven't altered the contents you will end up with the same problem.
You need to scale the content (and potentially translate the origin as well), if the program requests media then you can still have Ghostscript scale it, but you will need to set -dFIXEDMEDIA and the -dFitPage option. (Its probably easiest just to set -dFitPage, even if the file is an EPS rather than PostScript).