File tree Expand file tree Collapse file tree
developer-guide/converting-documents/convert-document-to-another-format Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from groupdocs .conversion import Converter
2+ from groupdocs .conversion .options .convert import WordProcessingConvertOptions
3+ from groupdocs .conversion .filetypes import WordProcessingFileType
4+
5+ def specify_output_format ():
6+ # Instantiate Converter with the input document
7+ with Converter ("./business-plan.docx" ) as converter :
8+ # Instantiate convert options to define the output format
9+ word_convert_options = WordProcessingConvertOptions ()
10+ # Set the output fomormat to TXT
11+ word_convert_options .format = WordProcessingFileType .TXT
12+
13+ # Convert the input document to TXT
14+ converter .convert ("./business-plan.txt" , word_convert_options )
15+
16+ if __name__ == "__main__" :
17+ specify_output_format ()
Original file line number Diff line number Diff line change 33import sys
44
55# Set license path
6- # os.environ["GROUPDOCS_LIC_PATH"] = "/path/to/your/license/file .lic"
6+ os .environ ["GROUPDOCS_LIC_PATH" ] = "C://Licenses//GroupDocs.Total .lic"
77
88# Console output colors
99YELLOW = "\033 [93m"
@@ -65,8 +65,9 @@ def print_intro():
6565 "developer-guide/converting-documents/get-possible-conversions/get_all_possible_conversions_for_current_file.py" ,
6666
6767 # Convert a Document to Another Format
68- "developer-guide/converting-documents/convert-document-to-another-format/convert_consecutive_document_pages.py" ,
6968 "developer-guide/converting-documents/convert-document-to-another-format/convert_document_to_another_format.py" ,
69+ "developer-guide/converting-documents/convert-document-to-another-format/specify_output_format.py" ,
70+ "developer-guide/converting-documents/convert-document-to-another-format/convert_consecutive_document_pages.py" ,
7071 "developer-guide/converting-documents/convert-document-to-another-format/convert_specific_document_pages.py" ,
7172
7273 # Convert a Document to Multiple Page Files
You can’t perform that action at this time.
0 commit comments