How to convert libreoffice ODT to PDF in bash
Clash Royale CLAN TAG#URR8PPP
up vote
7
down vote
favorite
I am using libreoffice under CentOS 6. I can convert ODT files to PDF with:
libreoffice --headless --convert-to pdf *.odt
but the problem is that it only works when no document is open in libreoffice.
When I specify --env:UserInstallation=file:///path/to/some/directory
as suggested in one of the comments of this question , it doesn't help.
What am I doing wrong? It is a nuisance to close all libreoffice instances before running the before command.
pdf libreoffice
add a comment |
up vote
7
down vote
favorite
I am using libreoffice under CentOS 6. I can convert ODT files to PDF with:
libreoffice --headless --convert-to pdf *.odt
but the problem is that it only works when no document is open in libreoffice.
When I specify --env:UserInstallation=file:///path/to/some/directory
as suggested in one of the comments of this question , it doesn't help.
What am I doing wrong? It is a nuisance to close all libreoffice instances before running the before command.
pdf libreoffice
add a comment |
up vote
7
down vote
favorite
up vote
7
down vote
favorite
I am using libreoffice under CentOS 6. I can convert ODT files to PDF with:
libreoffice --headless --convert-to pdf *.odt
but the problem is that it only works when no document is open in libreoffice.
When I specify --env:UserInstallation=file:///path/to/some/directory
as suggested in one of the comments of this question , it doesn't help.
What am I doing wrong? It is a nuisance to close all libreoffice instances before running the before command.
pdf libreoffice
I am using libreoffice under CentOS 6. I can convert ODT files to PDF with:
libreoffice --headless --convert-to pdf *.odt
but the problem is that it only works when no document is open in libreoffice.
When I specify --env:UserInstallation=file:///path/to/some/directory
as suggested in one of the comments of this question , it doesn't help.
What am I doing wrong? It is a nuisance to close all libreoffice instances before running the before command.
pdf libreoffice
pdf libreoffice
edited Apr 13 '17 at 12:22
Community♦
1
1
asked Apr 18 '15 at 12:04
Johan
3815
3815
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
7
down vote
accepted
That is unlikely going to work, as the suggestion in the comment is both incomplete (you cannot just specify some directory) and incorrect (--env:...
should be -env:..
.
Here is what I recommend you do:
- Stop all instances of libreoffice
Start libreoffice from the commandline without specifying
--headless
:libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt
you should replace
/home/username
with your home directory (and adjust.config
if you don't have that on your CentOS, I did this on Ubuntu and Linux Mint). The above will create a new configuration directory for the alternate libreoffice in your .config directory, without which you would get some error about java not being found.- Exit that instance of libreoffice
- That directory
/home/username/.config/libreoffice-alt
should now have been created for you.
Now start another libreoffice
from the command-line (doing so allows you to see some useful messages if things go wrong when starting the second instance), without the -env:...
, and while that is still running start the conversion using:
libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt --headless --convert-to pdf *.odt
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
On an Ubuntu 16.04 machine, I just ranlibreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.
– Kyle
Aug 31 at 23:10
add a comment |
up vote
7
down vote
One possible approach is to install unoconv
(if not already installed) and
unoconv file.odt
Please see man unoconv
for details
unoconv
is a command line utility that can convert any file format that LibreOffice can import, to any file format that
LibreOffice is capable of exporting.
unoconv
uses the LibreOffice’s UNO bindings for non-interactive conversion....
In some platforms it is also necessary to install libreoffice-headless
thanksAaron
Under CentOS7, I also had to add the packagelibreoffice-headless
to have it automated. If the user has never used it before, the first call tounoconv
fails with error 81 after creating a bunch of files in~/.config/
.
– Aaron D. Marasco
Feb 11 '16 at 14:32
1
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
1
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
add a comment |
up vote
0
down vote
why to do sso many things LibreOffice now supports odt to PDF in 2018 please see this video
New contributor
1
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
That is unlikely going to work, as the suggestion in the comment is both incomplete (you cannot just specify some directory) and incorrect (--env:...
should be -env:..
.
Here is what I recommend you do:
- Stop all instances of libreoffice
Start libreoffice from the commandline without specifying
--headless
:libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt
you should replace
/home/username
with your home directory (and adjust.config
if you don't have that on your CentOS, I did this on Ubuntu and Linux Mint). The above will create a new configuration directory for the alternate libreoffice in your .config directory, without which you would get some error about java not being found.- Exit that instance of libreoffice
- That directory
/home/username/.config/libreoffice-alt
should now have been created for you.
Now start another libreoffice
from the command-line (doing so allows you to see some useful messages if things go wrong when starting the second instance), without the -env:...
, and while that is still running start the conversion using:
libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt --headless --convert-to pdf *.odt
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
On an Ubuntu 16.04 machine, I just ranlibreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.
– Kyle
Aug 31 at 23:10
add a comment |
up vote
7
down vote
accepted
That is unlikely going to work, as the suggestion in the comment is both incomplete (you cannot just specify some directory) and incorrect (--env:...
should be -env:..
.
Here is what I recommend you do:
- Stop all instances of libreoffice
Start libreoffice from the commandline without specifying
--headless
:libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt
you should replace
/home/username
with your home directory (and adjust.config
if you don't have that on your CentOS, I did this on Ubuntu and Linux Mint). The above will create a new configuration directory for the alternate libreoffice in your .config directory, without which you would get some error about java not being found.- Exit that instance of libreoffice
- That directory
/home/username/.config/libreoffice-alt
should now have been created for you.
Now start another libreoffice
from the command-line (doing so allows you to see some useful messages if things go wrong when starting the second instance), without the -env:...
, and while that is still running start the conversion using:
libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt --headless --convert-to pdf *.odt
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
On an Ubuntu 16.04 machine, I just ranlibreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.
– Kyle
Aug 31 at 23:10
add a comment |
up vote
7
down vote
accepted
up vote
7
down vote
accepted
That is unlikely going to work, as the suggestion in the comment is both incomplete (you cannot just specify some directory) and incorrect (--env:...
should be -env:..
.
Here is what I recommend you do:
- Stop all instances of libreoffice
Start libreoffice from the commandline without specifying
--headless
:libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt
you should replace
/home/username
with your home directory (and adjust.config
if you don't have that on your CentOS, I did this on Ubuntu and Linux Mint). The above will create a new configuration directory for the alternate libreoffice in your .config directory, without which you would get some error about java not being found.- Exit that instance of libreoffice
- That directory
/home/username/.config/libreoffice-alt
should now have been created for you.
Now start another libreoffice
from the command-line (doing so allows you to see some useful messages if things go wrong when starting the second instance), without the -env:...
, and while that is still running start the conversion using:
libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt --headless --convert-to pdf *.odt
That is unlikely going to work, as the suggestion in the comment is both incomplete (you cannot just specify some directory) and incorrect (--env:...
should be -env:..
.
Here is what I recommend you do:
- Stop all instances of libreoffice
Start libreoffice from the commandline without specifying
--headless
:libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt
you should replace
/home/username
with your home directory (and adjust.config
if you don't have that on your CentOS, I did this on Ubuntu and Linux Mint). The above will create a new configuration directory for the alternate libreoffice in your .config directory, without which you would get some error about java not being found.- Exit that instance of libreoffice
- That directory
/home/username/.config/libreoffice-alt
should now have been created for you.
Now start another libreoffice
from the command-line (doing so allows you to see some useful messages if things go wrong when starting the second instance), without the -env:...
, and while that is still running start the conversion using:
libreoffice -env:UserInstallation=file:///home/username/.config/libreoffice-alt --headless --convert-to pdf *.odt
answered Apr 18 '15 at 12:37
Anthon
59.6k17101162
59.6k17101162
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
On an Ubuntu 16.04 machine, I just ranlibreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.
– Kyle
Aug 31 at 23:10
add a comment |
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
On an Ubuntu 16.04 machine, I just ranlibreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.
– Kyle
Aug 31 at 23:10
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
PS I have .config as well on CentOS
– Johan
Apr 18 '15 at 15:22
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
Instead of stopping all instances, you can simply log in as a different user, create the .config-files and copy those to your own home dir.
– Ole Tange
Feb 26 at 20:21
On an Ubuntu 16.04 machine, I just ran
libreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.– Kyle
Aug 31 at 23:10
On an Ubuntu 16.04 machine, I just ran
libreoffice --headless --convert-to pdf <filename>.odt
and it did it, without those prep steps. It did print a warning about Java tho.– Kyle
Aug 31 at 23:10
add a comment |
up vote
7
down vote
One possible approach is to install unoconv
(if not already installed) and
unoconv file.odt
Please see man unoconv
for details
unoconv
is a command line utility that can convert any file format that LibreOffice can import, to any file format that
LibreOffice is capable of exporting.
unoconv
uses the LibreOffice’s UNO bindings for non-interactive conversion....
In some platforms it is also necessary to install libreoffice-headless
thanksAaron
Under CentOS7, I also had to add the packagelibreoffice-headless
to have it automated. If the user has never used it before, the first call tounoconv
fails with error 81 after creating a bunch of files in~/.config/
.
– Aaron D. Marasco
Feb 11 '16 at 14:32
1
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
1
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
add a comment |
up vote
7
down vote
One possible approach is to install unoconv
(if not already installed) and
unoconv file.odt
Please see man unoconv
for details
unoconv
is a command line utility that can convert any file format that LibreOffice can import, to any file format that
LibreOffice is capable of exporting.
unoconv
uses the LibreOffice’s UNO bindings for non-interactive conversion....
In some platforms it is also necessary to install libreoffice-headless
thanksAaron
Under CentOS7, I also had to add the packagelibreoffice-headless
to have it automated. If the user has never used it before, the first call tounoconv
fails with error 81 after creating a bunch of files in~/.config/
.
– Aaron D. Marasco
Feb 11 '16 at 14:32
1
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
1
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
add a comment |
up vote
7
down vote
up vote
7
down vote
One possible approach is to install unoconv
(if not already installed) and
unoconv file.odt
Please see man unoconv
for details
unoconv
is a command line utility that can convert any file format that LibreOffice can import, to any file format that
LibreOffice is capable of exporting.
unoconv
uses the LibreOffice’s UNO bindings for non-interactive conversion....
In some platforms it is also necessary to install libreoffice-headless
thanksAaron
One possible approach is to install unoconv
(if not already installed) and
unoconv file.odt
Please see man unoconv
for details
unoconv
is a command line utility that can convert any file format that LibreOffice can import, to any file format that
LibreOffice is capable of exporting.
unoconv
uses the LibreOffice’s UNO bindings for non-interactive conversion....
In some platforms it is also necessary to install libreoffice-headless
thanksAaron
edited Feb 12 '16 at 14:54
answered Apr 18 '15 at 12:38
JJoao
6,9441826
6,9441826
Under CentOS7, I also had to add the packagelibreoffice-headless
to have it automated. If the user has never used it before, the first call tounoconv
fails with error 81 after creating a bunch of files in~/.config/
.
– Aaron D. Marasco
Feb 11 '16 at 14:32
1
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
1
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
add a comment |
Under CentOS7, I also had to add the packagelibreoffice-headless
to have it automated. If the user has never used it before, the first call tounoconv
fails with error 81 after creating a bunch of files in~/.config/
.
– Aaron D. Marasco
Feb 11 '16 at 14:32
1
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
1
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
Under CentOS7, I also had to add the package
libreoffice-headless
to have it automated. If the user has never used it before, the first call to unoconv
fails with error 81 after creating a bunch of files in ~/.config/
.– Aaron D. Marasco
Feb 11 '16 at 14:32
Under CentOS7, I also had to add the package
libreoffice-headless
to have it automated. If the user has never used it before, the first call to unoconv
fails with error 81 after creating a bunch of files in ~/.config/
.– Aaron D. Marasco
Feb 11 '16 at 14:32
1
1
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
@AaronD.Marasco, thank you very much for this important information! Probably there is a dependency missing in the spec file. I will add your tip to the answer.
– JJoao
Feb 12 '16 at 14:53
1
1
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
@JJoao, if you are a CentOS user, you should report your finding as a bug report.
– vonbrand
Feb 12 '16 at 19:32
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
Not a spec dependency... just a use case. The error 81 issue is supposedly fixed but I don't know what version; I guess CentOS doesn't have it yet.
– Aaron D. Marasco
Feb 12 '16 at 19:34
add a comment |
up vote
0
down vote
why to do sso many things LibreOffice now supports odt to PDF in 2018 please see this video
New contributor
1
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
add a comment |
up vote
0
down vote
why to do sso many things LibreOffice now supports odt to PDF in 2018 please see this video
New contributor
1
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
add a comment |
up vote
0
down vote
up vote
0
down vote
why to do sso many things LibreOffice now supports odt to PDF in 2018 please see this video
New contributor
why to do sso many things LibreOffice now supports odt to PDF in 2018 please see this video
New contributor
New contributor
answered yesterday
user42003
11
11
New contributor
New contributor
1
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
add a comment |
1
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
1
1
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your post, could you please edit your post to include the relevant steps needed to complete this task instead of only linking to a video. Please see this post
– kemotep
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f197063%2fhow-to-convert-libreoffice-odt-to-pdf-in-bash%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password