The WordProcessingFileType class defines Word Processing file formats, covering plain text and rich text variants.
Plain text files contain unformatted text with no font or page settings applied. Rich text files support formatting options such as font types, styles (bold, italic, underline), page margins, headings, bullets, numbers, and other features.
Files with .doc extension represent documents generated by Microsoft Word or other word processing documents in binary file format. Learn more about this file format here.
DOCX is a well-known format for Microsoft Word documents. Introduced from 2007 with the release of Microsoft Office 2007, the structure of this new Document format was changed from plain binary to a combination of XML and binary files. Learn more about this file format here.
Files with .DOT extension are template files created by Microsoft Word to have pre-formatted settings for generation of further DOC or DOCX files. Learn more about this file format here.
Files with DOTX extension are template files created by Microsoft Word to have pre-formatted settings for generation of further DOCX files. Learn more about this file format here.
Introduced and documented by Microsoft, the Rich Text Format (RTF) represents a method of encoding formatted text and graphics for use within applications. Learn more about this file format here.
ODT files are type of documents created with word processing applications that are based on OpenDocument Text File format. Learn more about this file format here.
Files with OTT extension represent template documents generated by applications in compliance with the OASIS’ OpenDocument standard format. Learn more about this file format here.
Text files created with Markdown language dialects is saved with .MD or .MARKDOWN file extension. MD files are saved in plain text format that uses Markdown language which also includes inline text symbols, defining how a text can be formatted such as indentations, table formatting, fonts, and headers. Learn more about this file format here.
fromgroupdocs.conversionimportConverterfromgroupdocs.conversion.options.convertimportWordProcessingConvertOptionsfromgroupdocs.conversion.filetypesimportWordProcessingFileTypedefspecify_output_format():# Instantiate Converter with the input documentwithConverter("./business-plan.docx")asconverter:# Define convert options; default output format is DOCXword_convert_options=WordProcessingConvertOptions()# Change the output format within the format family from DOCX to TXTword_convert_options.format=WordProcessingFileType.Txt# Convert the input document to TXTconverter.convert("./business-plan.txt",word_convert_options)if__name__=="__main__":specify_output_format()