libreoffice - 在 UNO LibreOffice 中使用 writer_pdf_Export 过滤器时出现问题
问题描述
我在 Ubuntu 16.03 上安装了 LibreOffice [LibreOffice 6.1.3.2 10(Build:2)] 和 sdk。
我使用了 sdk 包中的 java 示例 DocumentConverter 来转换不同格式的 odt。
使用“MS WORD 97”或“Text”没有问题,但使用“writer_pdf_Export”它以异常结束
好的
java -jar /home/js/libreoffice6.1_sdk/LINUXexample.out/class/JavaDocumentHandlingExamples/DocumentConverter.jar "./test" "MS WORD 97" "doc" "/home/js/libreoffice6.1_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files"
Connected to a running office ...
The converted documents will stored in "/home/js/libreoffice6.1_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files!
[test]
test1.odt
KO
java -jar /home/js/libreoffice6.1_sdk/LINUXexample.out/class/JavaDocumentHandlingExamples/DocumentConverter.jar "./test" "writer_pdf_Export" "pdf" "/home/js/libreoffice6.1_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files"
Connected to a running office ...
The converted documents will stored in "/home/js/libreoffice6.1_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files!
[test]
com.sun.star.task.ErrorCodeIOException: SfxBaseModel::impl_store <file:////home/js/libreoffice6.1_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files/test1.pdf> failed: 0x81a(Error Area:Io Class:Parameter Code:26)
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:158)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:122)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:312)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:281)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:81)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:618)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:145)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:129)
at com.sun.proxy.$Proxy5.storeAsURL(Unknown Source)
at DocumentConverter.traverse(DocumentConverter.java:137)
at DocumentConverter.main(DocumentConverter.java:216)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.star.lib.loader.Loader.main(Loader.java:132)
test1.odt
我需要通过java使用UNO接口转换为任何格式,我真的需要pdf也......有什么帮助吗?
解决方案
你在做“storeAsURL”还是“storeToURL”?
“storeAsURL”类似于“另存为”——当您以可编辑格式保存文档时。
“storeToURL”类似于“Export”——用于以不可编辑的格式生成输出。
所以我怀疑,如果你从“storeAsURL”切换到“storeToURL”,你会得到你想要的PDF。
推荐阅读
- reactjs - ReactJS:如何使用 ReactMarkDown?
- php - 因为我使用的是 Passport,所以我应该为 HomeController 使用哪个中间件
- javascript - Сodemirror 未将高度设置为 100%
- c# - 从新文件实现依赖注入
- wordpress - WPBakery 管理员从角色管理器中消失
- javascript - 遍历具有嵌套数组的对象数组并设置特定值
- firebase - 尝试使用 python 获取实时更新时,Cloud Firebase 中的“线程”
- api - 当我没有另一端的凭据时如何验证 API 请求
- airflow - 如何在使用“气流连接添加”时正确编码“额外”参数
- java - Jackson JSON 子类型:无法反序列化