Bug Hunting Session
Bug 121501 - writer_pdf_Export can't be used in sdk DocumentConverter.java example
Summary: writer_pdf_Export can't be used in sdk DocumentConverter.java example
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2018-11-18 21:09 UTC by JS Lair
Modified: 2019-07-08 15:51 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description JS Lair 2018-11-18 21:09:40 UTC
I installed LibreOffice [LibreOffice 10(Build:2)] and sdk on Ubuntu 16.03.

I used the java sample DocumentConverter in the sdk package to convert an odt in different formats.

With "MS WORD 97" or "Text" there is no problem but with "writer_pdf_Export" it ends in Exception

For example with odt to MS Word 97 (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!

and for odt to pdf (OK):

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

What's more unoconv using Python interface can convert to pdf!

I need to use the UNO interface through java to convert to any format, and I really need pdf also... Any help?
Comment 1 JS Lair 2018-11-18 21:47:42 UTC
I tested the export of the test1.odt example file with different filters, and here is the result:

OK:UOF text
OK:Text (encoded)
OK:Rich Text Format
OK:OpenDocument Text Flat XML
OK:Office Open XML Text
OK:MS Word 97
OK:MS Word 2007 XML
OK:MS Word 2003 XML
OK:HTML (StarWriter)
OK:DocBook File

KO:XHTML Writer File
KO:StarWriter 5.0 Vorlage/Template
KO:StarWriter 5.0
KO:StarWriter 4.0 Vorlage/Template
KO:StarWriter 4.0
KO:StarWriter 3.0 Vorlage/Template
KO:StarWriter 3.0
KO:StarOffice XML (Writer)
KO:PocketWord File
KO:MS Word 95
KO:MS WinWord 6.0
KO:AportisDoc Palm DB

The same test with unoconv is able to export also to writer_pdf_Export, MediaWiki and XHTML Writer File
Comment 2 Xisco Faulí 2018-11-19 10:09:21 UTC
You can't confirm your own bugs. Moving it back to UNCONFIRMED until someone
else confirms it.
Comment 3 Xisco Faulí 2019-07-08 15:51:29 UTC
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.