Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command-line interface only package to convert Microsoft Office files to PDF? Specifically, I need to be able to export

  • doc/docx (Word),
  • ppt/pptx (PowerPoint),
  • xls/xlsx (Excel), and
  • vsd/vsdx (Visio).

I am aware that an installation of LibreOffice comes with a CLI to convert documents, but it does not appear to to support Visio diagrams. Is there a package that does?

Ideally I'd like a solution that works on Linux, but I could find a way to use Windows if it would be far more practical. What I will very likely not have is a license to any MS products.

share|improve this question
what version of office? – Keltari Aug 21 '13 at 13:20
@Keltari I'm not sure. I don't think I will be working with anything pre-2003, but I think 2007 is a safe baseline. – Sean Allred Aug 21 '13 at 13:24
I dont have an office 2007 app to see, but check to see if you can save as PDF from the Save As. If so, then you can write a VBScript to convert to PDF. I know this can be done for 2010 and up. – Keltari Aug 21 '13 at 13:27
@Keltari I believe every version from 2003 on supports export as PDF. 2007 confirmed. Note though that I do not have a version of Office available, as I mentioned in the bit @-terdon edited out... – Sean Allred Aug 21 '13 at 13:30
Since 4.0, LO has a Visio import filter‌​. I never used it myself, so i can't tell how "powerful" it is, but it may be worth a try. – tohuwawohu Aug 21 '13 at 15:01

You can use powershell. You can write your own, but often MS already has such scripts written for you, because all recent office supports powershell and thus can be operated on by powershell scripts. Here are some examples, and you can find more in technet.

first, you probably can read this:

share|improve this answer

You can use docto its a really simple command line utility that allows you to convert Word Documents to pdf or any other format.

as simple as

docto -f C:\Directory\MyFile.doc -O "C:\Output Directory\MyTextFile.pdf" -T wdFormatPDF
share|improve this answer

Try setting up a PDF printer and make it default, then

Winword.exe  some.doc /q /n /mFilePrintDefault /mFileExit
share|improve this answer
Per the original question, I do not have a license for (therefore no copies of) any Microsoft Office products. winword.exe is definitely a Microsoft Office product. – Sean Allred Aug 21 '13 at 16:11
just saw the case, bare in mind that you probably will suffer formatting lost in most case for any method other than using a actual MS word to print to "PDF", even if print with a MS word viewer suffer formatting lost. – user218473 Aug 22 '13 at 14:26
I realize that, and it's something we took under consideration before embarking on this. – Sean Allred Aug 22 '13 at 14:43
alternatively, you can simply unzip it, then grep the document.xml, and use sed to get all the text between <w:t> and </w:t> – user218473 Aug 22 '13 at 14:59
that's how we read a docx in unix. – user218473 Aug 22 '13 at 15:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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