Documents4j remoteServer转换服务器设置

时间:2019-01-07 20:32:30

标签: java spring maven spring-boot documents4j

我正在使用Documents4j将rtf文件转换为pdf文件。我的计算机上没有MS word或任何文字,因此似乎需要使用一个远程转换器。此处的信息:http://documents4j.com/#/

我的项目是使用spring-boot设置的。我根据GitHub上的一些问题,使用maven-shade-plugin为maven设置了着色。但是,我无法运行Documents4j建议的命令来使服务器运行: java -jar documents4j-server-standalone-shaded.jar http://localhost:9998

我得到: Error: Unable to access jarfile documents4j-server-standalone-shaded.jar

我的pom.xml文件引入了阴影插件。

这是我pom.xml中的插件:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                        </configuration>
                    </execution>
            </executions>
        </plugin>

这是我使用的关于Documents4j的依赖项:(也许缺少重要的东西吗?)

    <dependency>
        <groupId>com.documents4j</groupId>
        <artifactId>documents4j-api</artifactId>
        <version>1.0.3</version>
    </dependency>
    <dependency>
        <groupId>com.documents4j</groupId>
        <artifactId>documents4j-client</artifactId>
        <version>1.0.3</version>
    </dependency>
    <dependency>
        <groupId>com.documents4j</groupId>
        <artifactId>documents4j-server-standalone</artifactId>
        <version>1.0.3</version>
    </dependency>

根据我在Documents4j页面上阅读的内容,该命令似乎应该可以正常工作,因此我假设未创建jar文件。

我似乎在任何地方都找不到该jarfile ...所以我无法使用路径而不是名称来运行java -jar命令。

此外,我不确定插件中可能需要什么“配置”。也许有一个技巧可以使行家阴影起作用?也许我误会了Documents4j页面在说什么?也许它对于Mac的工作方式有所不同?也许Documents4j不是一个好选择?

非常感谢您的协助。

1 个答案:

答案 0 :(得分:0)

请注意,只能在支持.NET并已安装Office的Windows Server上运行。 https://github.com/documents4j/documents4j/issues/53