Thetype exposes the following members.
Gets or sets a flag indicating whether inter-character spacing is automatically adjusted between regions of Latin text and regions of East Asian text in the current paragraph.
Gets or sets a flag indicating whether inter-character spacing is automatically adjusted between regions of numbers and regions of East Asian text in the current paragraph.
Gets or sets text alignment for the paragraph.
Gets or sets whether this is a right-to-left paragraph.
Gets collection of borders of the paragraph.
Gets or sets the position for a drop cap text.
Gets or sets a flag indicating whether East Asian line-breaking rules are applied to the current paragraph.
Gets or sets the value (in points) for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent.
Gets or sets a flag indicating whether hanging punctuation is enabled for the current paragraph.
True when the paragraph style is one of the built-in Heading styles.
True when the paragraph is an item in a bulleted or numbered list.
True if all lines in the paragraph are to remain on the same page.
True if the paragraph is to remains on the same page as the paragraph that follows it.
Gets or sets the value (in points) that represents the left indent for paragraph.
Gets or sets the line spacing (in points) for the paragraph.
Gets or sets the line spacing for the paragraph.
Gets or sets the number of lines of the paragraph text used to calculate the drop cap height.
Specifies the outline level of the paragraph in the document.
True if a page break is forced before the paragraph.
Gets or sets the value (in points) that represents the right indent for paragraph.
Returns a Shading object that refers to the shading formatting for the paragraph.
Gets or sets the amount of spacing (in points) after the paragraph.
True if the amount of spacing after the paragraph is set automatically.
Gets or sets the amount of spacing (in points) before the paragraph.
True if the amount of spacing before the paragraph is set automatically.
Gets or sets the paragraph style applied to this formatting.
Gets or sets the locale independent style identifier of the paragraph style applied to this formatting.
Gets or sets the name of the paragraph style applied to this formatting.
Specifies whether the current paragraph should be exempted from any hyphenation which is applied in the document settings.
Specifies whether the current paragraph's lines should be exempted from line numbering which is applied in the parent section.
Gets the collection of custom tab stops defined for this object.
True if the first and last lines in the paragraph are to remain on the same page as the rest of the paragraph.
If this property is false, Latin text in the middle of a word can be wrapped for the current paragraph. Otherwise Latin text is wrapped by whole words.
Resets to default paragraph formatting.
|Equals||(Inherited from Object.)|
|Finalize||(Inherited from Object.)|
|GetHashCode||(Inherited from Object.)|
|GetType||(Inherited from Object.)|
|MemberwiseClone||(Inherited from Object.)|
|ToString||(Inherited from Object.)|
// Create an "empty" document. Note that like in Microsoft Word, // the empty document has one section, body and one paragraph in it Document doc = new Document(); // This truly makes the document empty. No sections (not possible in Microsoft Word) doc.RemoveAllChildren(); // Create a new section node // Note that the section has not yet been added to the document, // but we have to specify the parent document Section section = new Section(doc); // Append the section to the document doc.AppendChild(section); // Lets set some properties for the section section.PageSetup.SectionStart = SectionStart.NewPage; section.PageSetup.PaperSize = PaperSize.Letter; // The section that we created is empty, lets populate it. The section needs at least the Body node Body body = new Body(doc); section.AppendChild(body); // The body needs to have at least one paragraph // Note that the paragraph has not yet been added to the document, // but we have to specify the parent document // The parent document is needed so the paragraph can correctly work // with styles and other document-wide information Paragraph para = new Paragraph(doc); body.AppendChild(para); // We can set some formatting for the paragraph para.ParagraphFormat.StyleName = "Heading 1"; para.ParagraphFormat.Alignment = ParagraphAlignment.Center; // So far we have one empty paragraph in the document // The document is valid and can be saved, but lets add some text before saving // Create a new run of text and add it to our paragraph Run run = new Run(doc); run.Text = "Hello World!"; run.Font.Color = Color.Red; para.AppendChild(run); // As a matter of interest, you can retrieve text of the whole document and // see that \x000c is automatically appended. \x000c is the end of section character Console.WriteLine("Hello World!\x000c"); // Save the document doc.Save(ArtifactsDir + "Section.CreateFromScratch.doc");