- //
- // This code is part of Document Solutions for Word demos.
- // Copyright (c) MESCIUS inc. All rights reserved.
- //
- using System;
- using System.IO;
- using System.Drawing;
- using System.Collections.Generic;
- using System.Linq;
- using GrapeCity.Documents.Word;
- namespace DsWordWeb.Demos
- {
- // This example shows how to specify font fill and line styles.
- public class FontFillLine
- {
- public GcWordDocument CreateDocx()
- {
- var doc = new GcWordDocument();
- var style = doc.Styles.Add("My Style", StyleType.Paragraph);
- style.Font.Size = 48;
- // Specify gradient fill for the font:
- var fill = style.Font.Fill;
- fill.Type = FillType.Gradient;
- var gradient = fill.GradientFill;
- gradient.Angle = 64;
- gradient.Stops[0].Color.RGB = Color.LightSeaGreen;
- gradient.Stops[1].Color.RGB = Color.Orange;
- // Specify the outline for the font:
- var line = style.Font.Line;
- line.Width = 1;
- fill = line.Fill;
- fill.Type = FillType.Solid;
- fill.SolidFill.RGB = Color.Blue;
- // Add sample text with the new style:
- doc.Body.Paragraphs.Add("Font Fill and Line styles.", style);
- // Done:
- return doc;
- }
- }
- }