0

I have a project in which I need to convert PDF file into png using ghost4j. The issue I am facing is that when I run my java code the console throws me this error:

Unable to load library 'gs': dlopen(libgs.dylib, 9): image not found

I googled this error and found that I also need to install ghost script and make some changes in the file libgs.dylib. I have installed ghost script using Mac Port but I am not able to find where this file libgs.dylib is located on my file system. I am clueless what to do next. Need Help.

-PS I am using Mac OS X 10.9.2 as my development environment.

4

1 回答 1

0

来自https://github.com/zippy1978/ghost4j/issues/29

设置 LD_LIBRARY_PATH 有助于:

$ port install ghostscript
$ port contents ghostscript | grep libgs
  /opt/local/lib/libgs.9.10.dylib
  /opt/local/lib/libgs.9.dylib
  /opt/local/lib/libgs.dylib
$ export LD_LIBRARY_PATH=/opt/local/lib

使用port contents命令显示的任何路径。

要使更改永久生效,您必须将其永久添加到 LD_LIBRARY_PATH。我不知道如何在 OSX 上做到这一点,因为我不是 Mac 用户,但在互联网上很容易找到。

另请参阅“osx install libgs.dylib”的搜索结果。

于 2014-04-22T05:24:47.510 回答