【问题标题】:Documents4j remoteServer conversion server setupDocuments4j remoteServer 转换服务器设置
【发布时间】:2019-01-07 20:32:29
【问题描述】:

我正在使用 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 文件引入了 shade 插件。

这是我的 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 命令。

另外,我不确定插件中可能需要什么“配置”。也许有一个技巧可以让 maven 着色工作?也许我误解了 Documents4j 页面在说什么?也许它对 Mac 的工作方式不同?也许 Documents4j 不是一个好的选择?

非常感谢所有帮助。

【问题讨论】:

  • 您启动服务器的机器是否提供 .NET 和 MS Word 安装?您需要拥有 Word(和有效的许可证)才能使用documents4j。

标签: java spring maven spring-boot documents4j


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-09
    • 2016-09-13
    • 2016-03-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多