노드 (Macox 및 Ubuntu에서 실행)에서 ghostscript를 사용하고 있습니다. 내 고스트 스크립트 명령은 다음과 같습니다.노드가있는 ghostScript가 치명적인 오류를 발생합니다.
/usr/local/bin/gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=output.pdf -dBATCH input1.pdf input2.pdf
이 명령을 수동으로 실행하면 작동합니다. 이 NodeJS에 의해 쫓겨 때,이 오류가 발생합니다 :
var execCommand = config.ghostScript + " -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=" + finalFileName + " -dBATCH " + inputFiles;
exec(execCommand, function (error, stdout, stderr) {
if (error !== null) {
var err = new Error("pdf could not be generated");
err.status = constants.HTTPCODE_INTERNAL_SERVER_ERROR;
throw err;
} else {
console.log("success");
}
어떤 아이디어 :
[2014-09-08 10:33:20.587] [INFO] console - { [Error: Command failed: GPL Ghostscript 9.10: Unrecoverable error, exit code 1
] killed: false, code: 1, signal: null }
Error: Command failed: GPL Ghostscript 9.10: Unrecoverable error, exit code 1
at ChildProcess.exithandler (child_process.js:647:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Socket.<anonymous> (child_process.js:966:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
노드의 코드는 다음과 같습니다?
입력 파일 사이에 공백이있는 방식으로 inputFiles에 문제가 있다고 생각하지만 NodeJS를 통해 inputfiles를 반복하고 각 공백을 구분해야합니다. – user1283633