Search code examples
pdfghostscriptpostscript

GhostScript - ps2pdf - Errors when executing


I have several Postscript files I need to convert to PDF for work. (No I cannot send you the PS files, it's confidential).

They were created using Adobe 3.0 standards : (%!PS-Adobe-3.0

%%Creator: Emtex - vdd2ps 212.5.1)

So i need to invoke ps2pdf12.

When I try ps2pdf12 test.ps output.pdf I get this : "Error: /undefined in ps2pdf12 Operand Stack:

Execution stack : %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval- - 2 %stopped_push --nostringval-- --nostringval-- %loop_continue --n ostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval -- Dictionary stack: --dict:1166/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Current file position is 9 "

I run the script using GhostScript 9.05 or 9.20 and I get the same error.

I also tried using directly ghostScript with things like "gs -o "output.pdf" -sDEVICE=pdfwrite -dCompatibilityLevel=1.2 -r=720 "test.PS" " but I get the same mistakes.

When I am in Ghostview to watch my PS and I go to File-->Convert and I choose pdfwrite and resolution = 720, I get the pdf...

Any ideas where my problem come from?

Thanks in advance


Solution

  • After several tries and checks with GSView, i managed to get the following quote and it seems to work fine.

    gswin32c.exe -o "output.pdf" -dNOSAFER -sDEVICE=pdfwrite -r720 -dAutoRotatePages=false -dCompatibilityLevel=1.2 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dNumRenderingThreads=2 -c "60000000 setvmthreshold" -f -dEPSCrop "test.PS"

    Thanks for your help :)