Created
October 23, 2022 10:22
-
-
Save aspose-com-gists/6961d2c30ccbbae86fc8cc4cdf8155cc to your computer and use it in GitHub Desktop.
Create Documents using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = open("new-file.txt", "w") | |
d.write("Hellow World") | |
d.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.words as aw | |
newdoc = aw.Document() | |
builder = aw.DocumentBuilder(newdoc) | |
font = builder.font | |
font.bold = True | |
font.name = "Arial" | |
font.size = 16 | |
font.underline = aw.Underline.DASH | |
paragraphFormat = builder.paragraph_format | |
paragraphFormat.first_line_indent = 8 | |
paragraphFormat.alignment = aw.ParagraphAlignment.JUSTIFY | |
paragraphFormat.keep_together = True | |
builder.writeln("new file content - hellow world.") | |
newdoc.save("outputfile.docx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment