Ask Your Question

Headless convert password-protected Word File to PDF [closed]

asked 2013-11-05 17:10:58 +0200

mciet gravatar image

updated 2015-08-28 13:50:38 +0200

Alex Kemp gravatar image


I'm using Ubuntu Server 12.04 64bit and LibreOffice 3.5 (from the official Ubuntu repository). My Java EE application needs to convert Word files (.doc and .docx) to PDF on the commandline.

Converting a non-password-protected Word file works like a charm. If I try to convert a password-protected Word file (.doc, .docx) to PDF, it fails without any stderr, e.g.:

server:~/pdftest# /usr/bin/libreoffice --headless -convert-to pdf 'myFile.doc' -outdir '/root/pdftest/'

Does somebody know what I'm doing wrong here or is this the regular behavior?

EDIT: If the goal is not clear: my Java application needs an output, which identifies failed conversion in order to handle the file in another way.

EDIT2: I'm aware of the possibility to check if there is a PDF after the conversion. If the PDF is not available, then I know, the conversion failed. But in my opinion it would be better, if the command throws an exception or asks for the password at least, but just doing nothing is a bit strange.

Thank you very much, Marco

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-13 09:01:48.853125

1 Answer

Sort by » oldest newest most voted

answered 2013-11-10 08:22:19 +0200

oweng gravatar image

updated 2013-11-10 08:23:21 +0200

What type of DOC/X are they and in which application were they created (e.g., MSO 2007, 2010, 2013)? Support for Microsoft Office 2010 and 2013 Agile decryption is coming in LO v4.2. If you can't wait until February 2014 for that release I advise grabbing a daily build of master to see if that fixes the issue. Just realised you are running Ubuntu. You may have to wait.

edit flag offensive delete link more


Thank you very much for your reply. Both files are created with MS 2013. The ".doc" file is a Word 97-2003 type and for the ".docx" I guess it is Word 2007-2013. Unfortunately I cannot wait. Now, the application checks, if the PDF is created or not, regardless of stdout and stderr.

mciet gravatar imagemciet ( 2013-11-11 12:51:44 +0200 )edit

Question Tools

1 follower


Asked: 2013-11-05 17:10:58 +0200

Seen: 1,701 times

Last updated: Nov 10 '13