Impossible to create a document.odt starting from a given template.ott using the shell script libreoffice with the --headless option Steps to reproduce: 1. With LO, make a simple template.ott, even a blank one 2. Open a terminal and execute one of the following three commands 2.1. $ libreoffice --headless /path/to/template.ott 2.2. $ libreoffice --headless -n /path/to/template.ott 2.3. $ libreoffice --headless --convert-to odt /path/to/template.ott 3. Execute $ file ~/template.odt Current behavior: 2.1. the command hangs 2.2. the command hangs 2.3. you get the message convert /home/user/template.ott -> /home/user/template.odt using OpenDocument Text Flat XML 3. you get template.odt: XML document text that is, you have got a .fodt document (a plain xml) despite the .odt suffix Expected behavior: one would get an OpenDocument Text, that is a zipped archive This expected behaviour would conform to the LO headless conversion to ods from a template.ots: it creates an OpenDocument Spreadsheet, not an XML document text Regards Raimondo Giammanco
Hi, It works for me with 4.2.5.2/4.3.0.1 under Fedora 20: $ libreoffice --headless --convert-to odt temtest.ott convert /home/maxim/Downloads/temtest.ott -> /home/maxim/Downloads/temtest.odt using writer8 $ file temtest.odt temtest.odt: OpenDocument Text Could you please try again with one of the latest versions?
Maxim, thank you fo the reply my first post came after tests on version 4.0 under Ubuntu and openSuse Now, under Ubuntu 12.04, this is the output with LO Stable and LO Fresh, taken from ppa $ libreoffice --version LibreOffice 4.1.6.2 410m0(Build:2) $ libreoffice --headless --convert-to odt /home/raimondo/TEMPLATE.ott convert /home/raimondo/TEMPLATE.ott -> /home/raimondo/TEMPLATE.odt using OpenDocument Text Flat XML $ file TEMPLATE.odt TEMPLATE.odt: XML document text $ libreoffice --version LibreOffice 4.2.4.2 420m0(Build:2) $ libreoffice --headless --convert-to odt /home/raimondo/TEMPLATE.ott convert /home/raimondo/TEMPLATE.ott -> /home/raimondo/TEMPLATE.odt using OpenDocument Text Flat XML Overwriting: /home/raimondo/TEMPLATE.odt $ file TEMPLATE.odt TEMPLATE.odt: XML document text Same output with LO from deb ( http://www.libreoffice.org/download/libreoffice-fresh/ ) $ libreoffice4.2 --version LibreOffice 4.2.5.2 61cb170a04bb1f12e77c884eab9192be736ec5f5 $ libreoffice4.2 --headless --convert-to odt /home/raimondo/TEMPLATE.ott convert /home/raimondo/TEMPLATE.ott -> /home/raimondo/TEMPLATE.odt using OpenDocument Text Flat XML Overwriting: /home/raimondo/TEMPLATE.odt $ file TEMPLATE.odt TEMPLATE.odt: XML document text Is there something else I'm missing?
Can't reproduce also with 4.2.5.2 under Ubuntu 14.04. I set this back to UNCONFIRMED, so others could try to reproduce. As a workaround, you could explicitly set the filter name, like '--convert-to odt:writer8'.
Hi Raimondo.. I think it's better you attach your "template.ott" here, if possible, so everyone can test using same source.
Created attachment 102094 [details] The simplest template
BTW, with the attached template the workaround of explicitly set the filter to use works for me (even with version 4.0 )
Looks like I got same result with you Rai (tested with your file): $ libreoffice --version LibreOffice 4.2.5.2 420m0(Build:2) $ libreoffice --headless --convert-to odt BlankTemplate.ott convert /home/christian/Downloads/BlankTemplate.ott -> /home/christian/Downloads/BlankTemplate.odt using OpenDocument Text Flat XML $ file BlankTemplate.odt BlankTemplate.odt: XML document text Tested on Ubuntu 12.04 x86 Same result with my own created file using 4.2.5.2. Perhaps related to "Default file format and ODF settings" in profile settings ?
David Tardon committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a3338f8969053f67a9034cb95b24aa228c2baee1 fdo#78989 set preferred filters for ODF types The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 89952 has been marked as a duplicate of this bug. ***