当前位置: 首页 > 面试题库 >

使用document4j将Doc转换为PDf

上官修文
2023-03-14
问题内容

我想尝试使用documents4j来将doc转换为PDF。我在http://documents4j.com/#/develop遵循这些说明
。当我键入mvn package然后按Enter时,一切似乎都正常运行,但是我明白了

C:\Users\Fabio\Downloads\docs-to-pdf-converter-master\docs-to-pdf-converter-master\docs-to-pdf-converter\documents4j [ma
ster +0 ~0 -237 | +24 ~0 -0 !]>     mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] documents4j
[INFO] documents4j-api
[INFO] documents4j-util-all
[INFO] documents4j-transformer-api
[INFO] documents4j-transformer
[INFO] documents4j-util-conversion
[INFO] documents4j-test
[INFO] documents4j-local
[INFO] documents4j-util-transformer-process
[INFO] documents4j-transformer-msoffice
[INFO] documents4j-transformer-msoffice-base
[INFO] documents4j-transformer-msoffice-test
[INFO] documents4j-transformer-msoffice-word
[INFO] documents4j-transformer-msoffice-excel
[INFO] documents4j-local-demo
[INFO] documents4j-util-ws
[INFO] documents4j-client
[INFO] documents4j-util-standalone
[INFO] documents4j-client-standalone
[INFO] documents4j-server
[INFO] documents4j-server-standalone
[INFO] documents4j-aggregation
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building documents4j 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ documents4j-parent ---
[INFO] Starting audit...
Audit done.

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building documents4j-api 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ documents4j-api ---
[INFO] Starting audit...
Audit done.

[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ documents4j-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Fabio\Downloads\docs-to-pdf-converter-master\docs-to-pdf-converter-m
aster\docs-to-pdf-converter\documents4j\documents4j-api\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ documents4j-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 16 source files to C:\Users\Fabio\Downloads\docs-to-pdf-converter-master\docs-to-pdf-converter-master\d
ocs-to-pdf-converter\documents4j\documents4j-api\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] documents4j ........................................ SUCCESS [  2.079 s]
[INFO] documents4j-api .................................... FAILURE [  1.119 s]
[INFO] documents4j-util-all ............................... SKIPPED
[INFO] documents4j-transformer-api ........................ SKIPPED
[INFO] documents4j-transformer ............................ SKIPPED
[INFO] documents4j-util-conversion ........................ SKIPPED
[INFO] documents4j-test ................................... SKIPPED
[INFO] documents4j-local .................................. SKIPPED
[INFO] documents4j-util-transformer-process ............... SKIPPED
[INFO] documents4j-transformer-msoffice ................... SKIPPED
[INFO] documents4j-transformer-msoffice-base .............. SKIPPED
[INFO] documents4j-transformer-msoffice-test .............. SKIPPED
[INFO] documents4j-transformer-msoffice-word .............. SKIPPED
[INFO] documents4j-transformer-msoffice-excel ............. SKIPPED
[INFO] documents4j-local-demo ............................. SKIPPED
[INFO] documents4j-util-ws ................................ SKIPPED
[INFO] documents4j-client ................................. SKIPPED
[INFO] documents4j-util-standalone ........................ SKIPPED
[INFO] documents4j-client-standalone ...................... SKIPPED
[INFO] documents4j-server ................................. SKIPPED
[INFO] documents4j-server-standalone ...................... SKIPPED
[INFO] documents4j-aggregation ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.037 s
[INFO] Finished at: 2015-12-16T12:36:18+01:00
[INFO] Final Memory: 17M/181M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project d
ocuments4j-api: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :documents4j-api

我试图删除C:\ Users \ My
User.m2文件夹,但是它不起作用。对于这个简单的问题,我感到很抱歉,但是我对maven还是很陌生,我不知道这可能是问题所在,也许是documents4j-api中的pom.xml?


问题答案:

JAVA_HOME指出的jre不是JDK。更改JAVA_HOME变量,它应该工作



 类似资料:
  • 问题内容: 我看到一些页面允许用户上传并返回文件,例如PdfToWord 是否可以使用Python或任何Unix命令将文件转换为文件? 提前致谢 问题答案: 如果您安装了LibreOffice 如果要为此使用Python:

  • 问题内容: 我正在寻找一种使用PHP将Word和Excel文件转换为PDF的方法。 这样做的原因是,我需要能够将各种格式的文件合并到一个文档中。我知道,如果我能够将所有内容转换为PDF,则可以使用PDFMerger(使用fpdf)将PDF合并为一个文件。 我已经能够从其他文件类型/图像创建PDF,但仍受Word Docs困扰。(我想我可以使用已经用于从html代码创建Excel文件的PHPExce

  • 我需要使用python将.doc和.docx文件转换为.pdf。我已经看到了一些可用的答案,但它们使用的是comtypes和OpenWordApplication。我不能那样做。我寻求的是一种使用一些python库的方法,这些库保留字体、表格、标题大小和图像等,而不打开MS Word或LibreOffice或类似的东西,如果需要的话,将.doc和.docx文件转换为某种中间格式(然后将该格式转换为

  • 我花了大量的时间试图确定到底出了什么问题,使用LibreOffice将pdf转换为docx(以及doc转换为docx)的代码。 我使用了两个windows run接口来测试运行一些我发现相关的代码,也尝试了python,但两者都不起作用。 我在Windows上安装了LibreOffice v6.0.2。 我一直在使用此代码的变体尝试将某些pdf文件转换为与特定pdf文件不相关的docx: 我已经在

  • 我对线程的新,并已启动了一个2线程应用程序,它运行一个基本的文档到PDF转换方法。客户端有要转换的Word2003文件。 Thread1代码

  • 本文向大家介绍Python实现将DOC文档转换为PDF的方法,包括了Python实现将DOC文档转换为PDF的方法的使用技巧和注意事项,需要的朋友参考一下 本文实例讲述了Python实现将DOC文档转换为PDF的方法。分享给大家供大家参考。具体实现方法如下: 希望本文所述对大家的Python程序设计有所帮助。