Преглед на файлове

Added new example HelloWorldAdvancedFormatting()

master
MadBoy_cp преди 10 години
родител
ревизия
db10339ead
променени са 1 файла, в които са добавени 28 реда и са изтрити 0 реда
  1. 28
    0
      Examples/Program.cs

+ 28
- 0
Examples/Program.cs Целия файл

@@ -22,6 +22,7 @@ namespace Examples
HelloWorld();
HelloWorldKeepLinesTogether();
HelloWorldKeepWithNext();
HelloWorldAdvancedFormatting();
RightToLeft();
Indentation();
HeadersAndFooters();
@@ -1447,6 +1448,33 @@ namespace Examples
}
}
static void HelloWorldAdvancedFormatting()
{
Console.WriteLine("\tHelloWorldAdvancedFormatting()");
// Create a document.
using (DocX document = DocX.Create(@"docs\HelloWorldAdvancedFormatting.docx"))
{
// Insert a new Paragraphs.
Paragraph p = document.InsertParagraph();
p.Append("I am ").Append("bold").Bold()
.Append(" and I am ")
.Append("italic").Italic().Append(".")
.AppendLine("I am ")
.Append("Arial Black")
.Font(new FontFamily("Arial Black"))
.Append(" and I am not.")
.AppendLine("I am ")
.Append("BLUE").Color(Color.Blue)
.Append(" and I am")
.Append("Red").Color(Color.Red).Append(".");
// Save this document.
document.Save();
Console.WriteLine("\tCreated: docs\\HelloWorldAdvancedFormatting.docx\n");
}// Release this document from memory.
}
/// <summary>
/// Loads a document 'Input.docx' and writes the text 'Hello World' into the first imbedded Image.
/// This code creates the file 'Output.docx'.

Loading…
Отказ
Запис