Ghost4j does not use ghostscript installation by default

I use Ghost4j to render PDF files, but sometimes it sometimes gives the following types of errors when trying to render documents created by MS Word

[main] ERROR org.ghost4j.Ghostscript  - GPL Ghostscript 9.18: Some glyphs of the font TimesNewRoman requires a patented True Type interpreter.

According to this thread , this could be due to the Ubuntu Ghostscript package that excludes certain fonts. So I compiled the latest Ghostscript (9.22) from the source and installed it, and now this is the version that appears when I use the command gs, but Ghost4j still seems to be using the old version 9.18.

How can I say to use the new version of Ghostscript?

+4
source share
1 answer

Ghost4j ghostscript , ghost4j, ghostscript libgs.so. ghostscript, libgs-dev ( Linux).   , - Ghost4j .  , Ubuntu, libgs-dev, , Linux 9.18   , libgs.so. 9.22 libgs.so ( ) /usr/lib/x 86_64-linux -gnu/libgs.so.9.22

ln  -fs /usr/lib/x86_64-linux-gnu/libgs.so.9.22
        /usr/lib/x86_64-linux-gnu/libgs.so

, , , : ( gs), ( gs). , Ghost4j 1.0.1 JNA 4.1.0

 <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>4.1.0</version>
    </dependency>

    <dependency>
        <groupId>org.ghost4j</groupId>
        <artifactId>ghost4j</artifactId>
        <version>1.0.1</version>
    </dependency>

, :

 @RequestMapping(value = "/gs/version", method = GET)
public GhostscriptRevision gsVersion() throws IOException {
    return Ghostscript.getRevision();
}

.

+2

Source: https://habr.com/ru/post/1688197/


All Articles