Ghostscript kann nicht über die Eingabeaufforderung ausgeführt werden

422
shani

Ich habe diesen Code verwendet, um die Größe einer PDF-Datei zu reduzieren:

cd C:\Program Files\gs\gs9.25\bin gswin64c.exe –h Gswin64c –sDEVICE=pdfwrite –dCompatibilityLevel=1.4 –dPDFSETTINGS=/printer –dNOPAUSE –dQUIET –dBATCH –sOutputFile=D:\path\filename.pdf D:\path\compressed.pdf 

Ich arbeite an der Windows 8-Eingabeaufforderung. Es hat erst letzte Woche funktioniert, aber jetzt, wenn ich den gswin64c.exe -hBefehl eingebe, erhalte ich folgende Fehlermeldung:

GPL Ghostscript 9.25 (2018-09-13) Copyright (C) 2018 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: See the file PUBLIC for details.  Error: /undefinedfilename in (\342\200\223h) Operand stack:  Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push  Dictionary stack: --dict:980/1684(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)-- Current allocation mode is local Last OS error: No such file or directory GPL Ghostscript 9.25: Unrecoverable error, exit code 1 

Jede Hilfe wäre sehr dankbar.

1

1 Antwort auf die Frage

0
harrymc

Sie haben einen Fehler in Ihrem Skript.

Die Linie :

cd C:\Program Files\gs\gs9.25\bin 

Sollte sein :

cd "C:\Program Files\gs\gs9.25\bin"