I try to convert a doc file to a pdf file with the linux bash.
I tried different ways like jodconverter, ghostscript, postscript and so on, but all didn't work as espected.
Additionally I can say that I have only the bash.

Is there any way, which you can advice me?

link|improve this question

60% accept rate
Thanks, but nothing works for me. :) – CSchulz Sep 19 '11 at 16:33
feedback

migrated from stackoverflow.com Sep 20 '11 at 6:09

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 0 down vote accepted

Have you tried unoconv?

I did, and it seems to work. This is what I did (after lots of googling :):

  1. I installed unoconv (I had Libre Office installed)
  2. Booted to console (no X server running)
  3. Started soffice in headless mode with this command:

    /usr/lib/libreoffice/program/soffice.bin -headless -nofirststartwizard -accept="socket,host=localhost,port=8100;urp;StarOffice.Service" &

After that, simple unoconv document.doc converted document.doc to document.pdf (pdf is default output format).

link|improve this answer
Thanks for the answer. I get following error "unoconv: UnoException during conversion: URL seems to be an unsupported one. The provided document cannot be converted to the desired format.". I searched for it at google, but I can't find any solution. – CSchulz Oct 5 '11 at 10:12
libreoffice -headless -convert-to pdf document.doc How about this? – Goran Jurković Oct 6 '11 at 12:38
The argument headless is deprecated. --headless is the new argument. :) I got following error: stat: cannot read file system information for `test.doc': Input/output error – CSchulz Oct 12 '11 at 8:28
Hm, it could be some kind of a file system problem... I assume test.doc is in your current directory, try stat test.doc It could be that you are not able to access that file at all. – Goran Jurković Oct 13 '11 at 14:31
Now it seems that the command work, but I can't find the output or an argument for it. – CSchulz Oct 14 '11 at 7:41
show 7 more comments
feedback
lowriter --convert-to pdf *.doc

lowriter is the 'writer' program from LibreOffice (maybe your distro's LibreOffice package differs - check this!).

link|improve this answer
Thanks but I haven't a running X-Server. – CSchulz Sep 20 '11 at 11:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.