0

I'm using a command similar to this:

gswin32c.exe -dNOPAUSE -dBATCH -q -dSAFER -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="path/output.pdf" <PSfiles>

This gives me a single pdf document with each PS document represented as a page. However, the page sizes do not translate well. The original PS files are all different sizes and each resulting pdf page is cutoff to the same size, which looks like landscape A4.

When I convert a single PS file with the exact same command, the page size is preserved. So it seems like since all the PS files are being sent to the same pdf, they must all have the same page size and I lose content. Is there anyway to preserve the document sizes while still using a single command?

Update: I was originally using GS 8.63, but I downloaded 9.06 and have the same issue. Additionally, I've narrowed the problem down. It seems like there is one specific PS file (call it problemFile.ps) that causes the problem, as I can run the command successfully as long as I disclude problemFile.ps. And it only causes a problem if it is the last file included on the command line. I can't post the entire file, but are there any potential problem areas I should look at?

Update2: Okay I was wrong in saying there is one specifc problem file. It appears that the page size of the last file included on the command line sets the maximum page size for all the resultant pages.

hwhalen
  • 1
  • 2

1 Answers1

1

As long as each PostScript file (or indeed each page) actually requests a different media size then the resulting PDF file will honour the requests. I know this at least used to work, I've tested it.

However there are some things in your command line which you might want to reconsider:

1) When investigating problems with GS, don't use -q, this will prevent Ghostscript telling you potentially useful things.

2) DON'T use -dPDFSETTINGS unless you have read the relevant documentation and understand the implications of each parameter setting.

3) You may want to turn off AutoRotatePages, or at least set it to /PageByPage

My guess is that your PostScript files don't request a media size and therefore use the default media. Of course I can't tell without seeing an example.

NB you also don't say what version of Ghostscript you are using.

KenS
  • 30,202
  • 3
  • 34
  • 51