IRONSOFTWAREHOME
Add Shadow Effect
using IronWord;
using IronWord.Models;

// Create new Word document
WordDocument doc = new WordDocument();

// Create and configure text style
TextStyle textStyle = new TextStyle();
textStyle.TextEffect = new TextEffect()
{
    ShadowEffect = Shadow.OuterShadow1,
};

// Create paragraph
Paragraph paragraph = new Paragraph();

// Create run with text and style
Run textRun = new Run(new TextContent("Hello World"));
textRun.Style = textStyle;

// Add run to paragraph
paragraph.AddChild(textRun);

// Add paragraph to document
doc.AddParagraph(paragraph);

// Export new Word document
doc.SaveAs("shadowEffect.docx");
Imports IronWord
Imports IronWord.Models

' Create new Word document
Dim doc As New WordDocument()

' Create and configure text style
Dim textStyle As New TextStyle()
textStyle.TextEffect = New TextEffect() With {
    .ShadowEffect = Shadow.OuterShadow1
}

' Create paragraph
Dim paragraph As New Paragraph()

' Create run with text and style
Dim textRun As New Run(New TextContent("Hello World"))
textRun.Style = textStyle

' Add run to paragraph
paragraph.AddChild(textRun)

' Add paragraph to document
doc.AddParagraph(paragraph)

' Export new Word document
doc.SaveAs("shadowEffect.docx")
NuGet Download
PM > Install-Package IronWord
Add Shadow Effect

Add Shadow Effect

Implementing Shadow Effects on Text

Shadow effects add depth and dimension to text by creating a shadow offset behind the characters. IronWord provides a predefined shadow preset through the Shadow class, Shadow.OuterShadow1, which can be applied quickly without manual configuration, alongside instance properties (blur radius, distance, direction angle, and more) for custom shadow configurations.

To add a shadow effect, create a TextStyle and configure its TextEffect property with the Shadow.OuterShadow1 static named instance. This preset provides a professionally designed shadow configuration with appropriate blur, distance, and angle settings, projecting the shadow away from the text to create a lifted appearance.

Once the text style is configured with the desired shadow effect, create a Run object containing TextContent and assign the style to the run. Add the styled run to a paragraph using AddChild, then include the paragraph in the document. This approach follows IronWord's document hierarchy and ensures the shadow effect is correctly applied to the output file.

Code Explanation

A shadow effect can be added to text within a Word document with just a few lines of code. For completeness, let's first initialize a new WordDocument instance called doc. Then, a TextStyle object is created and configured to incorporate a shadow effect by assigning the Shadow.OuterShadow1 static named instance to the TextEffect property.

To add the styled text with the shadow effect, a Paragraph is created, then a Run object is created containing TextContent with "Hello World". The configured textStyle is assigned to the Run, applying the shadow effect. The Run is added to the Paragraph using AddChild, and the Paragraph is added to the document. This follows the document hierarchy: DocumentParagraphRunTextContent. Finally, export the Word document.

For more examples and demonstrations, please navigate to the following article: How to Add Shadow Effect to Text

Explore Document Elements with IronWord Tutorials.
View on GitHub

Ready to Get Started?

Nuget Downloads 56,401Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required