I have a Mac which does not have Microsoft Word installed. Clicking on
docx file will open it in Apples Pages, which usually can read and
display it, but most of the time I just want to convert the file to a
more Portable Document Format.
brew install pandoc
If you use Windows or Linux, please read the installation instructions.
Convert to PDF
Pandoc can guess what format to convert to based on the file extension, so the command to convert
example.docx to PDF is quite simple.
pandoc example.docx -o example.pdf
The above command always generates a PDF with portrait layout. A quick
search guided me to a solution for how to generate a pdf with landscape
layout. It turns out that adding the flag
-V geometry:landscape fixes that.
pandoc example.docx -V geometry:landscape -o example.pdf