I have Java code that exports ODT file to PDF. This is working fine in Windows and MacOS but failing in Linux Mint 19.3. LibreOffice version 6.4.4.2. I can reproduce the same error using the DocumentConverter sample class. So I don't think I am doing something wrong in my code. The error is when storeAsURL()
method is called. Here is the stack trace from DocumentConverter.java
.
com.sun.star.task.ErrorCodeIOException: SfxBaseModel::impl_store <file:////home/leopold/Example.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:619)
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 com.example.oo.DocumentConverter.traverse(DocumentConverter.java:139)
at com.example.oo.DocumentConverter.main(DocumentConverter.java:218)
I am, however, able to successfully convert to PDF directly using soffice
:
/opt/libreoffice6.4/program/soffice --nologo --invisible --headless \
--convert-to pdf Example.odt
Is there any way I can generate more information about why this error is happening?