Leonardo Reyes
Leonardo Reyes

Reputation: 33

GhostScript PDF to PostScript

I have to convert pdf files (created with jasperreports) to postscript.

I'm using ghostscript (Version 9.19) to make the conversion.

The commmand i'm using is:

gswin64c -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile=file.ps file.pdf

The conversion is done without problem, but when i open the postscript file generated (using GSview 5.0), the top margin is crop by 2-3 cm, and some information to print is lost.

I have changed the device from ps2write to eps2write, used the property -g<width>x<height> with the page size in pixels, but the problem persist.

The file is to be printed in a preformated paper, so i can not use the postscript generated to print.

Can someone help?

Thanks

Upvotes: 1

Views: 7608

Answers (1)

KenS
KenS

Reputation: 31139

Its not possible to say with great certainty, but it sounds like the PDF mediaBox is larger than the media you have specified to GSView.

You can try using the -dDEVICEWIDTHPOINTS and -dDEVICEHEIGHTPOINTS along with -dFIXEDMEDIA and -dPDFFitPage, that should allow you to set up a specific media size, override the size in the PDF file and scale the result to fit the specified size.

Perhaps you could post an example PDF file, without that its very hard to comment sensibly.

Upvotes: 1

Related Questions