[英]Doc and Docx to PDF conversion , using Java on Linux
I have a Java code to convert doc,docx to pdf using document4j it work fine on windows, but in linux I have this problem. 我有一个Java代码,可以使用document4j将doc,docx转换为pdf,在Windows上可以正常工作,但是在Linux中,我有这个问题。 Can I use this library on linux? 我可以在Linux上使用该库吗? Whats alternatives can I have? 我可以有什么选择?
The error is 错误是
java.io.IOException: Cannot run program "cmd" (in directory "/tmp/1542047549404-0"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[na:1.8.0_171]
2018-11-12 18:32:29.508 ERROR 10831 --- [pool-1-thread-1] c.d.c.msoffice.MicrosoftWordBridge : Unable to run script: /tmp/1542047549404-0/word_start184242440.vbs
java.io.IOException: Could not execute [cmd, /S, /C, ""/tmp/1542047549404-0/word_start184242440.vbs""] in /tmp/1542047549404-0.
at org.zeroturnaround.exec.ProcessExecutor.invokeStart(ProcessExecutor.java:936) ~[zt-exec-1.8.jar!/:na]
I think there are several reasons listed on their homepage why conversion cannot work under linux: 我认为他们的主页上列出了几个原因,导致在Linux下无法进行转换:
[...] the LocalConverter can only be run if: [...]仅在以下情况下可以运行LocalConverter:
For alternative approaches see How to convert MS doc to pdf 有关替代方法,请参见如何将MS doc转换为pdf
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.