Explorar el Código

Added new example HelloWorldAdvancedFormatting()

master
MadBoy_cp hace 10 años
padre
commit
db10339ead
Se han modificado 1 ficheros con 28 adiciones y 0 borrados
  1. 28
    0
      Examples/Program.cs

+ 28
- 0
Examples/Program.cs Ver fichero

HelloWorld(); HelloWorld();
HelloWorldKeepLinesTogether(); HelloWorldKeepLinesTogether();
HelloWorldKeepWithNext(); HelloWorldKeepWithNext();
HelloWorldAdvancedFormatting();
RightToLeft(); RightToLeft();
Indentation(); Indentation();
HeadersAndFooters(); HeadersAndFooters();
} }
} }
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> /// <summary>
/// Loads a document 'Input.docx' and writes the text 'Hello World' into the first imbedded Image. /// Loads a document 'Input.docx' and writes the text 'Hello World' into the first imbedded Image.
/// This code creates the file 'Output.docx'. /// This code creates the file 'Output.docx'.

Cargando…
Cancelar
Guardar