Closed hamzashezad closed 4 years ago
I see this happening on windows 10 with ghostscript 9.27 too. Also updated Ghostscript to 9.50 and reinstalled ghostscript4js package without success. First run works like a charm, second run crashes app without any feedback.
console.log(gs.MIN_SUPPORTED_REVISION);
console.log(gs.MAX_SUPPORTED_REVISION);
gs.execute(param_ghostscript)
.then(() => {
// Ghostscript returned successfully
logger.info(svcName + ' | Successfully converted PDF to PNG');
}.catch((err) => {
// Error in ghostscript execution
logger.error(svcName + ' | Error converting PDF document to OCR readbable format: ' + err);
});
the catch-path is not executed at the second run. The whole process seems to die without any feedback.
Node Version 10.16.3
Same problem. first run is okay second run crash the app without any feedback.
Ghostscript.version()
:
{
product: 'GPL Ghostscript',
copyright: 'Copyright (C) 2019 Artifex Software, Inc. All rights reserved.',
revision: 950,
revisiondate: 20191015
}
Hi @NickNaso Do you have an idea how to fix this ? Or how to downgrade to 9.22 on macos (installed from brew) ? I have only one version in /usr/local/Cellar/ghostscript/ and it's 9.50.
Thanks !
+1 on this on mac. On the second run it gives me
[1] 89399 segmentation fault node --inspect index.js
@NickNaso thoughts?
EDIT
I manage it to work by using exec instead of ghostscript4js:
exec(`gs -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=${outputFront.path} ${tmpFront.path} && gs -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=${outputBack.path} ${tmpBack.path}`, async (err, stdout, stderr) => {
Hi everybody,
I'm closing the issue because the release 3.2.0
should solve the problem.
OS: macOS 10.14.5 Node version: 10.15.3 Ghostscript version: 9.27 (2019-04-04) Electron version: 5.0.7 Ghostscript4js version: 3.1.1
I am converting postscript files to text files using the following:
It works the first time but my electron application crashes when I try to convert a second file.
The command runs fine on bash but gives a segmentation fault when I run it on Node REPL:
Note
job2.txt
was not created and it crashed after with a segmentation fault.