Closed will3942 closed 4 years ago
Hi @will3942, it seems that you are using Ghostscript version 9.06 and for now ghostscript4js only supports versions from 9.19 to 9.21. I had same problem on my linux local machine. The API has been changed so I chose to stay compatible with the modern API. What you can try to do is to install new Ghostscript version.
Please keep me updated.
Correct, this fixed it at least on Ubuntu. On Debian however I think the issue was that some libs (libgs.so
) were installed to /usr/lib
but libgss*
were installed to /usr/lib/linux-x86...
, on Ubuntu all libs were installed to the latter directory.
We just ran into this too, on Debian. We tried copying usr/lib/x86_64-linux-gnu/libgss*
to /usr/lib
, but that didn't work. Turns out, @NickNaso is correct, there's no way this can work on 9.06. The API it is complaining about:
https://www.ghostscript.com/doc/current/API.htm#set_arg_encoding
does not exist in 9.06:
https://www.ghostscript.com/doc/9.06/API.htm
Compiling 9.21 resolved the issue.
This might not be obvious to everyone, you can create a Docker container based on Debian stretch instead of jessie. Stretch comes with ghostscript 9.20.
In my case my Dockerfile changed
before
FROM node:carbon
ENV GS4JS_HOME=/usr/lib
after
FROM node:carbon-stretch
ENV GS4JS_HOME=/usr/lib/x86_64-linux-gnu
@Prinzhorn Yes you are right. Do you think that if I document it could be helpful? If you want you can create a section on docs and explain how to use the module with Docker. We are trying to work on the module to avoid all these problems and to do that we are integrating the source code of Ghostscript and compile it directly from the module, so at the end you don't need to install it previously on your machine. What do you think? It could be a good idea? Thank for your feedback.
@NickNaso I've added the Docker example https://github.com/NickNaso/ghostscript4js/pull/34
We are trying to work on the module to avoid all these problems and to do that we are integrating the source code of Ghostscript and compile it directly from the module, so at the end you don't need to install it previously on your machine. What do you think? It could be a good idea? Thank for your feedback.
I honestly don't know what the best approach with native node modules is. But installing a consistent and tested version alongside the module from npm would be great, otherwise you never know what's on the host system.
I like the idea of including the module personally, but I'm just some guy on the internet :)
I can
npm install
fine withnpm install ghostscript4js --GS4JS_HOME="/usr/lib"
however when try to actually execute GS I get the following error.This is on Debian using Docker.
node: symbol lookup error: /usr/lib/node_modules/ghostscript4js/build/Release/ghostscript4js.node: undefined symbol: gsapi_set_arg_encoding
Libraries are there and I installed everything using
apt-get -y install libgs-dev ghostscript
Thanks!