Pandoc : Command Line Tool for Document Format Conversion

Pandoc is a command line open-source tool for quick conversion of documents both in terms of the markup format and file type format. It can convert from dozens of markup formats into even more types of formats. We can use this tool on Windows, Linux and macOS.

Pandoc comes with a manual in the HTML format which contains all the details the users would need in order to use it. But we can also give the command pandoc –help to see the same help on the screen. As far as the Windows version is concerned, the program comes as a massive 200 MB standalone EXE file. Nothing else is needed for it to work. But if you want to convert a document to the PDF format, you will need LaTeX library to be installed.

Pandoc for Windows

Pandoc is very easy to use. It has a very simple command line syntax. If you want to convert an input file into another format, then you can simple give the Pandoc command followed by the input file, then -o and then the output file. For example, if you want to convert happy.txt into happier.docx then you can give the following command:

pandoc.exe happy.txt -o happier.docx

The Microsoft Word document produced works fine on all the different office software such as Libre Office, Open Office and Star Office.

Pandoc for Windows

In some other file format conversions, the output is produced in a fragmented style and might produce sub-folders. If you want to create an self-contained standalone output file, then you have to specify the -s switch in the command line. For example,

pandoc.exe -s happy.txt -c main.css -o test.html

The above command packs the CSS file and the text content inside the same HTML file. If we do not specify the -s switch then it will produce the HTML file that requires an external CSS file.

You can download Pandoc from https://github.com/jgm/pandoc.