Use UnRTF to convert RTF files to HTML files. Use djvutoxml command from DjVuLibre library ( ) to convert DjVu to XML. Use pstopdf command to convert PostScript to PDF. Please refer to LibreOffice documentation for details: If you are a Terminal regular, you may not want to leave the comfort of the command line to perform any of your daily technical activities.
Convert ps to pdf mac command line windows#
On Windows command line, the convert-to parameter uses only one dash. The output file will be named input_file.TargetFileExtension. Note that the square brackets around : mean that this part is optional. If you have LibreOffice installed on your system, you can run soffice command in headless mode to convert documents: $ soffice -headless -convert-to input_file.xxx Use cupsfilter command to convert TXT to PDF and HTML to PDF. Use textutil command to convert among txt, rtf, rtfd, html, doc, docx, odt, wordml, and webarchive formats.
Convert ps to pdf mac command line mac os x#
Specfic Document Format Conversions Mac OS X Note that pandoc supports the newer XML-based docx MS Word format but not the older OLE-based doc MS Word format. Use pandoc command to convert amongst popular markup formats: Use paps command ( ) to format UTF-8 plain text files. Unfortunately, enscript does not support UTF-8 encoding. Use enscript command ( ) to convert text files to PostScript, HTML, and RTF. Use cupsfilter command to convert non-PDF formats to PDF. textutil is based on the Cocoa Framework, so it isn't available on Linux. The -info option extracts basic metadata from files of these formats. Use textutil command to convert plain text to rtf, rtfd, html, doc, docx, odt, wordml, and webarchive formats. Use xml_grep to extract text from XML document: xml_grep example.xml -text_onlyĮxtract text only from mytag tag: xml_grep 'mytag' example.xml -text_only
Use the djvutxt command to extract text from DjVu, assuming a text layer exsits. DjVuĭjVuLibre ( ), an open source DjVu library and viewer, comes with a suite of command line utilities. Use html2text command ( ) to extract text from HTML file. Use pdftotext command to extract text from PDF file, assuming a text layer exists. Poppler library ( ), based on Xpdf, comes with a suite of PDF tools. For a list of supported encodings run $ iconv -l The -c option discards unconvertible characters, and pointy brackets denote required options. The basic usage is $ iconv -c -f -t input.txt > output.txt Use iconv command to convert plain text from one encoding to another. For image files make sure you have ImageMagick installed, then use identify command to extract image metadata. Use file command to obtain basic metadata for most file formats. Everyone should embrace the mantra "plain text is beautiful". Distribute documents as plain text using UTF-8 encoding whenever possible. This document outlines some ideas for document conversion on Linux and Mac OS X platforms using command line tools.