简体   繁体   English

在UNO LibreOffice中使用writer_pdf_Export过滤器时出现问题

[英]Problem when using writer_pdf_Export filter in UNO LibreOffice

I installed LibreOffice [LibreOffice 6.1.3.2 10(Build:2)] and sdk on Ubuntu 16.03. 我在Ubuntu 16.03上安装了LibreOffice [LibreOffice 6.1.3.2 10(Build:2)]和sdk。

I used the java sample DocumentConverter in the sdk package to convert an odt in different formats. 我在sdk包中使用了Java示例DocumentConverter来转换不同格式的odt。

With "MS WORD 97" or "Text" there is no problem but with "writer_pdf_Export" it ends in Exception 使用“ MS WORD 97”或“文本”没有问题,但是使用“ writer_pdf_Export”则以异常结尾

OK

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 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

I need to use the UNO interface through java to convert to any format, and I really need pdf also... Any help? 我需要通过Java使用UNO接口将其转换为任何格式,并且我真的也需要pdf ...任何帮助吗?

Are you doing "storeAsURL" or "storeToURL"? 您正在执行“ storeAsURL”还是“ storeToURL”?

"storeAsURL" is analogous to "Save As" -- for when you are saving a document in an editable format. “ storeAsURL”类似于“另存为”-用于以可编辑格式保存文档时。

"storeToURL" is analogous to "Export" -- for generating an output in an uneditable format. “ storeToURL”类似于“导出”-用于生成不可编辑格式的输出。

So I suspect that, if you switch from "storeAsURL" to "storeToURL", you'll get the PDF you wanted. 因此,我怀疑,如果您从“ storeAsURL”切换为“ storeToURL”,则会获得所需的PDF。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM