# IronWord > The C# DOCX Library. Build, edit & export Word documents in .NET applications without using Interop. Supports .NET Framework. A single-file summary of the IronWord documentation: 46 pages, each as its own abstract, so a model can read the documentation in one pass rather than fetching every URL. Blog posts are not included — see https://ironsoftware.com/word/csharp/llms.txt for the link index, and https://ironsoftware.com/word/csharp/llms-full-catalog.txt for one that covers the blog too. ## Getting Started ### Setup IronWord on your Android applications. https://ironsoftware.com/word/csharp/get-started/android/ IronWord is a robust library enabling developers to read and write Word documents in Android applications using .NET MAUI. The article "Setup IronWord on your Android applications" provides a comprehensive guide to integrating IronWord into your Android projects, emphasizing seamless and efficient document management. It begins with an introduction to IronWord, highlighting its capabilities for handling Word documents natively within Android apps. The guide then delves into installation procedures, offering step-by-step instructions on setting up IronWord within a .NET MAUI environment. Developers are advised on configuration settings and dependencies necessary for optimal performance. The article also covers core functionalities, including reading, writing, and manipulating Word documents, all tailored to suit Android applications' needs. Practical examples illustrate how developers can implement these features, ensuring a smooth development process. Additionally, the guide addresses common issues and troubleshooting tips to overcome potential setup hurdles. By the end of the article, developers will possess the knowledge required to incorporate IronWord into their Android applications, significantly enhancing their app’s document-handling capabilities. This resource is invaluable for developers eager to leverage Word processing in Android apps efficiently. ### Setup IronWord on AWS Lambda https://ironsoftware.com/word/csharp/get-started/aws/ The article "Setup IronWord on AWS Lambda" serves as a comprehensive guide for developers looking to integrate IronWord with AWS Lambda, a serverless computing service. It begins by outlining the basic requirements for using IronWord, including necessary software installations and configurations. The guide then provides a step-by-step walkthrough for setting up IronWord within the AWS Lambda environment, emphasizing key considerations such as runtime selection, memory allocation, and timeout settings to optimize performance. It highlights the advantages of using IronWord in a serverless architecture, such as scalability and cost-effectiveness, making it an ideal solution for handling Word document processing tasks efficiently. The article also touches on troubleshooting common issues that may arise during setup and offers best practices for maintaining a seamless integration. By following the instructions provided, users can leverage IronWord to automate and streamline document-related workflows, thus taking their Word document tasks to the next level. Whether you're new to AWS Lambda or looking to enhance your existing setup, this guide offers valuable insights and practical tips to ensure a successful integration of IronWord. ### How to Run IronWord on Azure: Step-by-Step Guide https://ironsoftware.com/word/csharp/get-started/azure/ The article "How to Run IronWord on Azure: Step-by-Step Guide" provides a comprehensive walkthrough for deploying IronWord, a .NET library, on Microsoft Azure. It begins by outlining the prerequisites, including setting up a valid Azure account and the necessary .NET environment. The guide emphasizes the importance of having the latest version of IronWord and offers instructions on acquiring it. Readers are guided through the process of creating a new Azure Web App, detailing configurations and settings essential for optimal performance. The article highlights the integration of IronWord with Azure services to enhance Word document automation tasks, including the processing, creation, and modification of documents. Additionally, it addresses common challenges and troubleshooting tips to ensure a smooth deployment. Emphasis is placed on security best practices and scalability, ensuring that applications can handle increased loads efficiently. Throughout the guide, practical code examples and screenshots are provided to facilitate understanding. By the end of the article, users will be equipped with the knowledge to leverage Azure's robust infrastructure to run IronWord applications, thus elevating their word processing tasks to a professional level. This guide is ideal for developers seeking to enhance their cloud-based document processing solutions. ### How to Run IronWord in a Docker Container on Linux. https://ironsoftware.com/word/csharp/get-started/docker/ The article titled "How to Run IronWord in a Docker Container on Linux" provides a comprehensive guide for setting up and deploying IronWord in Docker containers on Linux systems. IronWord is a versatile tool compatible with both Linux and Windows environments, ideally suited for Azure, AWS, or any .NET-ready host. Docker is recommended for packaging and running IronWord due to its ability to ensure consistent performance across various stages of development, testing, and production, particularly for generating or manipulating Word documents programmatically. The article suggests using specific 64-bit Linux distributions like Ubuntu 24.04+, Ubuntu 22.04, Debian 12+, and RHEL/UBI 8 or 9 for optimal IronWord operation — Microsoft doesn't publish official CentOS runtime images post .NET Core 3.1. It also advises utilizing Microsoft's official Docker images for a streamlined setup process. The IronWord NuGet package can be easily integrated into any .NET project. Detailed examples are provided for setting up Dockerfiles on different Linux distributions, such as Ubuntu 24.04 with .NET 8, Debian 12 with .NET 8, and RHEL UBI 8 with .NET 8. The article concludes with troubleshooting tips, emphasizing the importance of installing necessary fonts for proper document rendering within Linux containers. ### Setup IronWord on your iOS applications. https://ironsoftware.com/word/csharp/get-started/ios/ The article titled "Setup IronWord on your iOS applications" provides a comprehensive guide for developers looking to integrate IronWord into their iOS projects. It begins by highlighting the advantages of using IronWord for handling Word documents on iOS, emphasizing its ease of use and seamless integration capabilities. The article then outlines the initial setup process, detailing the necessary steps to install IronWord, including downloading the library and configuring your development environment. It provides clear instructions on configuring the environment to recognize IronWord, ensuring compatibility and optimal performance. Additionally, the guide covers the basic functionalities offered by IronWord, such as reading, editing, and creating Word documents directly within an iOS application. It also touches on advanced features, like formatting and styling options, offering practical examples to illustrate these capabilities. The article concludes by encouraging developers to explore IronWord’s extensive documentation and user support for further customization and troubleshooting, reinforcing its potential to enhance app functionality and user experience. Overall, this resource serves as an essential starting point for developers eager to leverage the power of IronWord in their iOS applications. ### Applying .NET 10 License Keys to C# Word Library | IronWord https://ironsoftware.com/word/csharp/get-started/license-keys/ The article titled "Applying Software License Keys to C# Word Library | IronWord" from Iron Software provides a comprehensive guide on managing and applying license keys in IronWord for C# applications. To remove restrictions or watermarks when deploying projects live, users need to add an IronWord license key, which can be purchased or obtained through a free 30-day trial. The guide outlines the process in several steps, starting with downloading the latest version of IronWord. It then details how to apply the license key by adding specific code at the application's startup or configuring it globally using Web.Config, App.Config, or a .NET Core appsettings.json file. The article addresses a known issue with IronWord versions released before 2024.3.5 concerning ASP.NET projects and .NET Framework versions 4.6.2 or later, advising users to consult a troubleshooting article if needed. It emphasizes verifying the license key's application by checking the IsLicensed property and validates the key's validity using provided code snippets. The guide encourages users to follow a tutorial on getting started with IronWord and offers support through Iron Software's resources and contact information. ### IronWord macOS Setup Guide https://ironsoftware.com/word/csharp/get-started/mac/ The IronWord macOS Setup Guide provides a comprehensive walkthrough for .NET developers to integrate IronWord into macOS applications, enabling the manipulation of Word documents in C#. Despite its common usage on Windows and Linux, IronWord operates efficiently on macOS with a proper setup. The guide outlines essential prerequisites including .NET 6 or 7 SDK and Homebrew, alongside compatibility for macOS 11 (Big Sur) or later, supporting both Apple Silicon and Intel architectures. A key requirement is the installation of libgdiplus via Homebrew to handle graphical operations crucial for rendering DOCX content. Addressing potential System.Drawing.Common errors, this guide ensures the necessary native image rendering library is installed. The guide advises installing the standard IronWord NuGet package for seamless integration across different Mac hardware platforms. IronWord is notably compatible with Apple Silicon chips, allowing developers on M1 or M2 machines to utilize the same package and setup procedures. For optimal functionality, developers using Visual Studio for Mac or JetBrains Rider should target .NET 6 or higher. This guide equips developers with the tools needed to effectively deploy IronWord within macOS environments. ### Windows Support | IronWord https://ironsoftware.com/word/csharp/get-started/windows/ IronWord is a versatile library designed for creating and editing Word documents within .NET projects on Windows platforms. It is compatible with Windows 10, Windows 11, and Windows Server 2016 and newer, supporting a wide range of .NET versions including .NET 10, 9, 8, 7, 6, .NET Core, .NET Standard 2.0+, and .NET Framework 4.6.2 and above. IronWord depends on the IronSoftware.System.Drawing package for graphical operations such as rendering and processing DOCX content; on Windows this typically resolves through GDI+, which ships with the OS, allowing IronWord to still operate efficiently in headless and server-based environments such as Windows Server Core configurations, though certain advanced operations might require system-level libraries that need to be manually installed. For installation on Windows, IronWord is available as a NuGet package, supporting both x86 and x64 systems, and is fully compatible with the specified .NET frameworks. For optimal deployment, developers can streamline their projects by removing unused architecture folders from the /runtimes directory. This flexibility ensures that IronWord can be seamlessly integrated into various development environments, providing a robust solution for Word document manipulation on Windows. ## Tutorials ### Work with Document Elements in C# | IronWord https://ironsoftware.com/word/csharp/tutorials/document-element/ The article "Work with Document Elements" on IronWord's website provides a comprehensive guide for .NET C# developers on manipulating Word document elements using the IronWord library. Document elements form the foundational components of Word documents, such as text and images. The tutorial is structured to help developers add and modify text and images within Word documents effectively. For text management, the tutorial covers adding, appending, and splitting text, offering methods like the `Split` function to organize text into smaller segments for easier manipulation. It also includes detailed instructions on setting text styling, allowing developers to customize the font family, size, color, and apply styles like bold, italic, strikethrough, underline, superscript, and subscript. This customization enhances the visual appeal of the text. On the image management front, the guide instructs on loading images from files and configuring their properties. Developers can set image dimensions, position, text wrapping, and distance from document corners to ensure optimal image display within documents. These features collectively enable the creation of visually engaging and content-rich Word documents, enhancing the document's communicative effectiveness. ## How-To Guides ### Add Images to DOCX in C# - IronWord Tutorial & Examples https://ironsoftware.com/word/csharp/how-to/add-image/ IronWord enables C# developers to programmatically insert images into DOCX files using the ImageContent class. The library supports multiple image formats including JPG, PNG, BMP, TIFF, and GIF, allowing for versatile document automation and report generation. To add an image, developers create a WordDocument instance, load the image using ImageContent with the file path, and then add it to the document using the AddImage() method. Images can be inserted directly or as child elements within paragraphs for better document hierarchy and text flow control. The ImageContent class provides customizable properties such as width, height, and text wrapping, giving developers precise control over image positioning and formatting. The process is straightforward: install IronWord via NuGet, instantiate a new document, define the image object, add it to the document, and save the file. This functionality is particularly useful for automated document generation, where images need to be dynamically inserted based on data or user requirements. The library maintains image quality across all supported formats, with each format serving specific purposes - JPEG for photographs, PNG for transparent graphics, BMP for uncompressed quality, TIFF for high-quality printing, and GIF for simple animations. ### C# Style Text in DOCX: Font, Color & Format | IronWord https://ironsoftware.com/word/csharp/how-to/add-style-text/ IronWord's TextStyle class empowers .NET developers to programmatically apply comprehensive text formatting to Word documents, mirroring Microsoft Word's styling capabilities. The library enables formatting options including fonts, colors, bold, italic, underline, and more through a simple API. Developers can quickly implement text styling by installing IronWord via NuGet, creating a WordDocument object, and applying TextStyle properties to TextContent elements. The styling process involves creating styled text content, setting properties like font family, size, color, and text attributes (bold, italic, etc.), then adding the formatted text to paragraphs within the document. The example demonstrates creating red, bold, 16-point Arial text through straightforward C# code. IronWord's approach provides programmatic control over document formatting, making it ideal for automated report generation, template creation, and consistent document styling scenarios. The TextStyle class offers essential formatting options that combine to create professionally formatted documents, supporting both predefined colors and custom hex values for precise brand matching. ### Add Table to DOCX in C# - IronWord Tutorial & Guide https://ironsoftware.com/word/csharp/how-to/add-table/ IronWord is a C# library that enables developers to programmatically create and manipulate tables in Word documents. The library allows users to construct Table objects with specified dimensions, apply comprehensive styling options including borders, colors, and zebra striping, and populate cells with diverse content types. Tables are created by instantiating the Table class with row and column parameters, then accessing cells through zero-based indexing using [row, column] notation. Each cell can contain various content elements including text, images, shapes, paragraphs, and even nested tables through the AddChild method. The workflow involves downloading the IronWord library, populating cells with content, assembling cells into rows, creating tables by adding rows, initializing a Word document with the table, and exporting the final DOCX file. The library provides flexible content management approaches, allowing developers to either instantiate TableCell objects with initial content or add content incrementally. This functionality is particularly useful for generating structured documents like invoices, reports, and data summaries, with the library offering comprehensive control over both content organization and visual presentation in the resulting Word documents. ### Add Text to C# Word DOCX Files | IronWord Tutorial https://ironsoftware.com/word/csharp/how-to/add-text/ IronWord is a C# library that simplifies adding text to DOCX files through its AddText method. The library supports both basic text insertion and complex paragraph-based document structures, making it ideal for automated report generation and templating systems. To get started, developers install IronWord via NuGet, create a WordDocument instance, call AddText() with desired content, and save using SaveAs(). The straightforward API handles all underlying DOCX structure automatically, allowing developers to focus on content creation. Direct text addition is particularly useful for simple document generation, template population, batch processing, and quick prototyping. The library enables dynamic content population through programmatic actions, making it valuable for business applications that require automated document generation. IronWord's approach eliminates the complexity typically associated with DOCX manipulation, providing a clean interface for text insertion tasks ranging from basic memos to complex reports. The tutorial demonstrates how minimal code is required to create functional DOCX documents with added text content. ### Edit DOCX Text in C# - Modify Word Documents | IronWord https://ironsoftware.com/word/csharp/how-to/edit-text/ IronWord is a C# library that enables programmatic editing of text in Word documents while preserving formatting. The library provides direct access to paragraph text runs, allowing developers to modify existing DOCX content with precise control. To edit text, users load a document using `WordDocument`, access paragraphs through an index, modify text via the `Texts` array, and save changes. Text runs represent segments of text with consistent formatting, and IronWord maintains the document's original structure, layout, and styles during modifications. The library parses documents into a hierarchical object structure where each paragraph contains one or more independently accessible text runs. This granular control is particularly useful for updating template documents, personalizing form letters, and maintaining dynamic reports in business applications. The API offers a simple workflow: install the NuGet package, load the DOCX file, navigate to target content, modify text through the Texts array, and export the updated document. IronWord ensures formatting integrity throughout the editing process, making it suitable for professional document management where maintaining consistent styling is crucial while updating specific content programmatically. ### Extract Images from DOCX in C# - IronWord Tutorial https://ironsoftware.com/word/csharp/how-to/extract-images/ IronWord is a C# library that simplifies extracting embedded images from DOCX files through its ExtractImages() method. This powerful API allows developers to programmatically access all images within Word documents, providing both raw image data and metadata such as dimensions and format. The extraction process is straightforward - simply load a Word document using the WordDocument class and call ExtractImages() to retrieve a collection of image objects. Each extracted image can be saved to disk in various formats, with full access to properties like width and height. This functionality is particularly useful for content migration, media management, document workflow automation, and digital archiving applications. The library maintains consistency with other Iron Software products, offering similar API patterns across their suite. IronWord requires proper licensing for production use, following Iron Software's standard licensing model with perpetual licenses and comprehensive support options. The tutorial demonstrates a practical example using a sample DOCX file containing multiple images across different pages, showing how developers can iterate through extracted images, save them with custom naming conventions, and access their metadata for further processing or analysis. ### Extract Text from DOCX in C# | IronWord Tutorial https://ironsoftware.com/word/csharp/how-to/extract-text/ IronWord provides a powerful C# library for extracting text from DOCX files through its `ExtractText()` method. This comprehensive tutorial demonstrates how to programmatically access and extract text content from Word documents, including entire documents, specific paragraphs, and table cells. The library offers a simple API that maintains the logical reading order of documents while processing headers, paragraphs, lists, and other text elements sequentially. The tutorial covers a quickstart guide showing how to install the IronWord NuGet package and implement basic text extraction with just a few lines of code. Users can create or load a WordDocument object and extract all text using the `ExtractText()` method, or target specific elements by accessing the Paragraphs collection or table cells directly. This functionality is particularly valuable for document processing, data analysis, content indexing systems, and content management solutions. The extracted text preserves the document's structure and reading order, making it ideal for applications requiring document analysis, search indexing, or data extraction pipelines. The tutorial provides detailed code examples and demonstrates various extraction scenarios, from simple full-document extraction to more granular paragraph-specific processing, enabling developers to implement sophisticated document processing workflows in their C# applications. ### Mail Merge Word Documents in C# | IronWord https://ironsoftware.com/word/csharp/how-to/mail-merge/ IronWord is a C# library that performs Word mail merge by populating MERGEFIELD placeholders in a Word template with data, without requiring Microsoft Office Interop. Merge fields created in Microsoft Word or any compatible tool are detected automatically, and every operation is reached through the WordDocument.MailMerge entry point. The MailMerge facade exposes Execute overloads that fill fields from an IDictionary keyed by field name, from two parallel sequences of field names and values, or from a DataTable or DataRow whose column names match the merge fields. For documents with repeating content such as invoice line items, ExecuteWithRegions expands TableStart and TableEnd regions once per row of a matching DataTable or DataSet. Templates can be inspected before merging using GetFieldNames, GetRegionNames, and GetFields, which return MergeField objects describing each field's Name, Instruction, Kind, and RegionName. The MergeFieldKind enum distinguishes Value, TableStart, TableEnd, and NextRecord fields. Merge behavior is controlled through MailMergeOptions, including RemoveUnusedFields, RemoveUnusedRegions, NullValueReplacement, and case-insensitive field-name matching that mirrors Microsoft Word. This makes IronWord well suited to generating personalized letters, invoices, certificates, and reports at scale in backend services and cloud deployments. ### Remove Text from Word DOCX in C# - IronWord Tutorial https://ironsoftware.com/word/csharp/how-to/remove-text/ IronWord is a C# library that enables developers to programmatically remove text from Word DOCX documents while maintaining document structure and formatting integrity. The library offers multiple methods for text removal, including deleting entire paragraphs, specific text runs, and finding text by content before deletion. To use IronWord, developers install it via NuGet Package Manager, load DOCX files using the WordDocument class, access paragraphs or text runs by their index, and call the Remove() method on target elements. The library uses zero-based indexing for paragraph access, where Remove() completely eliminates the selected paragraph including all its content, formatting, and embedded elements like images or hyperlinks. After removal, the document automatically adjusts its structure with subsequent paragraphs shifting up to fill gaps. IronWord also supports removing specific formatted text within paragraphs by targeting individual text runs, which represent text segments with consistent formatting properties. This granular control allows developers to precisely manipulate document content while preserving the formatting and structure of surrounding elements, making it an efficient solution for automated document editing tasks in C# applications. ### Replace Text in Word Documents with C# | IronWord https://ironsoftware.com/word/csharp/how-to/replace-words/ IronWord is a C# library that enables developers to programmatically find and replace text in Word documents without requiring Microsoft Office Interop. This independence from Microsoft Office makes it particularly suitable for cloud deployments, containerized applications, and automated document processing pipelines. The library provides a straightforward solution for automating document updates, personalizing templates, and managing bulk content operations. With just a few lines of code, developers can load DOCX files, replace specified text, and save updated documents. The process involves using the WordDocument constructor to load existing documents, accessing paragraphs through the Paragraphs property, and utilizing the ReplaceText method for modifications. This method takes two string parameters - the text to find and its replacement - and performs case-sensitive replacements of all matching instances within selected paragraphs. IronWord's direct manipulation of Word documents results in faster, more reliable, and scalable solutions compared to traditional Office Interop approaches. This makes it ideal for backend processes, web applications, and scenarios requiring fine-grained control over document modifications, such as updating product names, changing dates, or personalizing customer information in templates and reports. ### Add Glow Effect to Text in C# Word Documents | IronWord https://ironsoftware.com/word/csharp/how-to/text-effect-glow-effect/ IronWord enables C# developers to add glow effects to text in Word documents, creating luminous auras around characters for visual emphasis. The glow effect is particularly useful for highlighting headers, titles, and important content in presentations, marketing materials, and professional documents. Implementation involves creating a Glow object with customizable properties like radius and color, embedding it within a TextEffect object, and assigning it to the text element's style. The library offers a streamlined approach with just one line of code for basic glow effects: `someTextElement.Style.TextEffect = new IronWord.Models.TextEffect { GlowEffect = new IronWord.Models.Glow { GlowRadius = 8, GlowColor = System.Drawing.Color.FromArgb(180, 0, 128, 255) } };`. The workflow follows a simple 5-step process: downloading the library, applying effects to text, configuring the Glow object, assigning it to TextEffect, and exporting the document. Creating the Glow object separately follows separation of concerns principles, improving code maintainability and enabling reuse across multiple text elements. This pattern aligns with other Iron Software products' approach to document processing, ensuring consistency in implementation. ### C# Gradient Text Effect Tutorial | IronWord Guide https://ironsoftware.com/word/csharp/how-to/text-effect-gradient-effect/ IronWord is a C# library that enables developers to add gradient text effects to Word documents programmatically. The library's TextStyle class includes a GradientEffect property that allows smooth color transitions across text characters. Users can choose from a single built-in gradient preset, DefaultGray, or create custom gradients with multiple color stops. The implementation process involves creating a TextStyle object, populating its GradientEffect property with a Gradient object, and applying this style to text elements. The gradient effects can be either linear (transitioning colors in a straight line) or radial (transitioning from a central point outward). This functionality is particularly useful for creating visually appealing headers, titles, and promotional materials where emphasis is needed. The tutorial provides code examples demonstrating both basic implementation using preset gradients and more advanced customization options. IronWord follows a similar pattern to its sister library IronPPT, making it intuitive for developers already familiar with the Iron Software ecosystem. The library requires license key configuration before use and offers a straightforward five-step workflow for implementing gradient text effects in C# applications. ### C# Text Reflection Effect Tutorial | IronWord Guide https://ironsoftware.com/word/csharp/how-to/text-effect-reflection-effect/ IronWord's C# API enables developers to add professional text reflection effects to Word documents with minimal code. The library allows creation of mirror-like reflections that simulate text sitting on a glossy surface, enhancing visual depth and drawing reader attention. Implementation requires just one line of code for basic effects, using the TextStyle object with a Reflection property. The workflow involves downloading the IronWord C# library, applying text effects to new or existing text, instantiating the Reflection class for preset effects, configuring properties for customization, and exporting the edited document. The TextStyle object serves as a central configuration point, enabling consistent reflection effects across multiple text elements. Default reflection creates a subtle mirror image below text with automatic opacity fade, suitable for business documents and presentations. The effect works particularly well for headers, titles, and emphasizing key information. IronWord provides various configurable properties for reflection effects, allowing developers to customize the visual appearance to meet specific design requirements. This functionality helps create modern, elegant documents that effectively highlight important content through enhanced visual presentation. ### Add Shadow Effect to Text in C# Word Documents | IronWord https://ironsoftware.com/word/csharp/how-to/text-effect-shadow-effect/ IronWord enables developers to add professional shadow effects to text in C# Word documents through its comprehensive API. The library offers both a preset shadow option, OuterShadow1, for quick implementation and customizable properties including blur, distance, and color for unique styling needs. To apply a shadow effect, developers create a TextStyle object with a ShadowEffect property, then assign it to text elements. The process can be as simple as one line of code for preset shadows or involve detailed configuration for custom effects. Shadow effects enhance text depth and distinction, making them particularly valuable for professional documents, presentations, and reports where text needs visual prominence. The implementation integrates seamlessly with existing document workflows, supporting both newly created and existing text. IronWord's approach mirrors familiar design patterns, similar to creating presentations in PowerPoint, but provides programmatic control. The library includes shadow effects in all license tiers, making it accessible for various project scales. The minimal workflow involves downloading the library, applying effects to text, choosing preset or custom shadows, configuring properties as needed, and exporting the enhanced document. ### C# Text Outline Effect Tutorial | IronWord Guide https://ironsoftware.com/word/csharp/how-to/text-effect-text-outline-effect/ IronWord's C# library enables developers to add text outline effects to Word documents, creating visible borders around characters that enhance readability and visual impact. The TextOutlineEffect class provides customizable control over outline properties including color, thickness, and style. This feature is particularly useful for creating eye-catching headers, watermarks, and emphasizing important content in business documents. The library offers both a quick one-line implementation using TextOutlineEffect.DefaultEffect for rapid prototyping and a comprehensive API for granular control over outline properties. Text outlines serve multiple purposes: improving contrast against complex backgrounds, establishing visual hierarchy, and adding professional polish to documents. The implementation involves creating a TextStyle object, populating its TextOutlineEffect property, and applying it to text elements. This functionality is valuable for various applications including invoices, marketing materials, and technical documentation. The outline effect ensures text remains legible across different printing surfaces and viewing devices by creating a buffer zone around characters. IronWord's approach balances simplicity for quick implementations with advanced customization options for meeting specific branding guidelines or accessibility requirements in professional document generation. ### Convert DOCX to PDF | IronWord https://ironsoftware.com/word/csharp/how-to/word-to-pdf/ IronWord provides an efficient solution for converting DOCX files to PDF within C# projects, utilizing its `ToPdf` method to support automated workflows, report distribution, and archival needs. The process is streamlined with minimal steps: install the IronWord library, load a DOCX file using `new WordDocument()`, call `ToPdf()` for conversion, and save or distribute the resulting PDF. This method preserves the document's formatting, including fonts, images, and layout, ensuring the PDF appears consistently across all platforms—ideal for official documentation and client-facing materials. For high-volume tasks, IronWord supports batch processing of entire directories using `Directory.GetFiles()`, with error handling to manage corrupt files and console logging for progress tracking. This approach suits archive migrations, automated workflow pipelines, and scheduled report generation, offering options for parallel processing to enhance performance. Before conversion, verify file existence and maintain output naming consistency to avoid bottlenecks. The solution effectively handles large-scale document processing while ensuring robust and reliable PDF generation. ## Code Examples ### Code Example: Add Image | IronWord https://ironsoftware.com/word/csharp/examples/add-image/ The article titled "Code Example: Add Image | IronWord" provides a practical guide on incorporating images into Word documents using IronWord in C#. It begins by explaining how to load an existing Word document and then configure an image with specific dimensions to fit your needs. The process involves creating a new Paragraph object to house the image, which is inserted using the AddImage method. Once the image is added, this paragraph is incorporated into the document through the AddParagraph method. The tutorial essentially walks you through modifying a Word document by inserting an image and then exporting the updated document. Additionally, the article offers links to related documentation and resources, such as a GitHub page, tutorials, a how-to guide, and class documentation. For users encountering any issues, there is an option to report them directly on the page. This resource is aimed at developers looking to enhance their Word processing applications by adding image manipulation capabilities. ### Code Example: Add List | IronWord https://ironsoftware.com/word/csharp/examples/add-list/ In the article titled "Code Example: Add List | IronWord," readers are introduced to the process of creating a structured Word document featuring a multi-level list using the IronWord library in C#. The tutorial provides a clear, step-by-step guide on how to implement lists within Word documents programmatically, demonstrating the capabilities of IronWord in handling Word processing tasks efficiently. The article emphasizes the ease and efficiency of using IronWord for such tasks, making it a compelling option for developers working with C#. Additionally, the page offers various resources for further exploration, including related documentation links, tutorials, and a how-to guide, ensuring that readers have ample support for any additional questions or implementation challenges they may encounter. The article also provides links to download the IronWord DLL and encourages users to report any issues directly on the page, fostering a collaborative environment for improvement and troubleshooting. Overall, this resource serves as a valuable tool for developers seeking to enhance their Word document creation capabilities within the C# programming environment. ### Code Example: Add Paragraph | IronWord https://ironsoftware.com/word/csharp/examples/add-paragraph/ The IronWord "add-paragraph" feature provides developers with a robust tool for inserting entire paragraphs into existing Word documents, facilitating the efficient structuring and organization of content. This feature allows the integration of multiple text elements with varied formatting into a single, cohesive block. It is particularly advantageous for creating dynamic documents where text needs to be grouped and styled, such as reports, articles, or letters. The functionality supports various formatting options, including bold and italic styles within a single paragraph, ensuring a clean document structure and enhanced readability. The process to add a paragraph involves five key steps: instantiating a new WordDocument object, creating a Paragraph object, adding text to the paragraph using the AddText method, appending the paragraph to the document with the AddParagraph method, and saving the document as a DOCX file using the SaveAs method. This procedure ensures that the paragraph is correctly integrated into the document, maintaining its flow and layout. The guide provides sample code demonstrating these steps, highlighting IronWord's capabilities in simplifying document management tasks in C#. ### Code Example: Add Style Text | IronWord https://ironsoftware.com/word/csharp/examples/add-style-text/ The "Add Style Text" feature in IronWord for C# enables developers to format and style text in Word documents with precision. This functionality allows users to control various text attributes such as font family, size, color, and styles like bold, italic, underline, and strike-through. Through the creation of a Text object and the configuration of its TextStyle, developers can ensure a customized appearance for individual text elements, which is particularly beneficial for dynamically generating professionally formatted documents like reports or letters. The TextStyle class facilitates both simple and complex styling within a document. The process to add styled text involves five main steps: initializing a WordDocument object, creating a Text object with desired content, defining a TextStyle with specified attributes (e.g., Arial font, size 14, blue color, bold), adding the styled Text object to the document, and saving the document as "save_document.docx". This procedure ensures that the text is formatted with all specified styles preserved in the resulting DOCX file. The guide includes examples, sample code, and resources for further exploration, enhancing the ease with which developers can implement sophisticated text styling in Word documents using IronWord. ### Code Example: Add Table | IronWord https://ironsoftware.com/word/csharp/examples/add-table/ The article titled "Code Example: Add Table | IronWord" provides a guide on creating structured information using tables in IronWord. Tables, essential for organizing and presenting data in rows and columns, are widely used for tasks like scheduling and data organization. The article explains that each table cell is an intersection of a row and column, allowing for detailed data arrangement. To create a table in IronWord, a user needs to specify the number of rows and columns to instantiate the table. Users can customize the table's styling to meet specific requirements. Accessing each cell is done using a [row, column] format, enabling users to apply individual styles and integrate various elements such as text runs, paragraphs, images, and shapes within each cell. Once the table is set up, it can be incorporated into a new Word document. The article also provides links to related documentation, tutorials, and resources for further guidance, as well as options to download the IronWord DLL or report issues. This comprehensive guide ensures users can seamlessly add and organize tables in their Word documents using IronWord. ### Code Example: Add Glow Effect | IronWord https://ironsoftware.com/word/csharp/examples/add-text-effect-glow-effect/ The article titled "Code Example: Add Glow Effect | IronWord" offers a detailed guide on applying a glow effect to text using IronWord. The process involves configuring the `TextEffect` property within a `TextStyle` object. The glow effect is characterized by a luminous border around the text, which can be customized with specific color and radius parameters through a `Glow` instance. Higher radius values yield a more diffused glow, whereas lower values create a tighter halo. The article explains the step-by-step procedure: create a `TextStyle`, configure a `TextEffect` with a `Glow`, and apply it to a `Run` object containing the desired `TextContent`. This `Run` is then added to a `Paragraph`, which is subsequently included in the document. The document hierarchy followed is Document → Paragraph → Run → TextContent. The article provides a code snippet that demonstrates creating a new Word document and applying the glow effect to the text "Hello World". Finally, the document is exported as a new file. For additional examples and demonstrations, readers are directed to a related article on adding glow effects to text. ### Code Example: Add Gradient | IronWord https://ironsoftware.com/word/csharp/examples/add-text-effect-gradient-effect/ IronWord offers a gradient effect feature that enhances text appearance through smooth color transitions. This functionality is facilitated by the Gradient class, which provides a single built-in preset, Gradient.DefaultGray, to be used with the GradientEffect property of a TextEffect. To utilize this effect, you must create a TextStyle object and configure its TextEffect with a GradientEffect. The built-in preset simplifies the process by providing a ready-to-use color scheme. Once the TextStyle is set, it is applied to a Run containing TextContent. This Run is added to a Paragraph and then inserted into the document, ensuring the gradient effect is maintained. The example code shows the creation of a new Word document and applying the gradient effect by assigning the Gradient.DefaultGray to the GradientEffect property. The structured document follows a hierarchy: Document → Paragraph → Run → TextContent. After configuring and applying the style, the document is exported. For additional examples and tutorials, readers are encouraged to explore further documentation available through the provided links. ### Code Example: Add Reflection Effect | IronWord https://ironsoftware.com/word/csharp/examples/add-text-effect-reflection-effect/ The article "Code Example: Add Reflection Effect | IronWord" provides a detailed guide on applying a reflection effect to text using the IronWord library. It describes how the reflection effect creates a mirrored image beneath the text, adding a sophisticated touch to documents. The process begins with creating a `TextStyle` and configuring its `TextEffect` property with a `Reflection` instance. By default, this instance applies standard reflection parameters, though customization is possible by adjusting properties like distance, blur, and transparency. To implement the styled text, a `WordDocument` object named `doc` is created, followed by the instantiation of a `TextStyle` object configured with the reflection effect. Next, a `Paragraph` is formed, and a `Run` object containing `TextContent` such as "Hello World" is created. The `TextStyle` is applied to the `Run`, and the `Run` is added to the `Paragraph` using `AddChild`. The `Paragraph` is then incorporated into the document, maintaining the hierarchy: Document → Paragraph → Run → TextContent. The article concludes by guiding users on saving the document with the newly applied reflection effect, enhancing its visual appeal. ### Code Example: Add Shadow Effect | IronWord https://ironsoftware.com/word/csharp/examples/add-text-effect-shadow-effect/ IronWord's tutorial on implementing shadow effects on text within Word documents provides a detailed guide using the Shadow class, which offers a single predefined shadow preset, Shadow.OuterShadow1, that enables users to quickly apply a professional shadow style without manual configuration. The shadow effects, including blur, distance, and angle settings, give text a lifted appearance by projecting shadows away from the text. To implement this, a TextStyle is created and configured with the desired shadow effect. This style is then applied to a Run object containing text content, which is added to a Paragraph, and subsequently integrated into the document. The step-by-step process involves initializing a WordDocument, setting up the TextStyle with a shadow effect, and constructing the document hierarchy: Document → Paragraph → Run → TextContent. This method ensures the shadow effect is accurately reflected in the output file. The tutorial includes a practical code example demonstrating the application of shadow effects using minimal code lines. Users are encouraged to explore more examples and tutorials for comprehensive guidance on document elements with IronWord. ### Code Example: Add Text Outline | IronWord https://ironsoftware.com/word/csharp/examples/add-text-effect-text-outline-effect/ The article titled "Code Example: Add Text Outline | IronWord" provides a detailed guide on implementing text outline effects in documents using IronWord. Text outlines enhance text visibility and style by adding a border around each character, which is particularly useful for creating bold, eye-catching text or ensuring readability against busy backgrounds. The process begins by creating a `TextStyle` object and configuring its `TextEffect` property with `TextOutlineEffect.DefaultEffect`, a preset configuration suited for most needs. Developers can customize the outline's width, color, and line style for specific visual effects. Once the text style is established, a `Run` containing the desired `TextContent` is created, and the configured style is applied to it. This styled run is then added to a paragraph, which is subsequently incorporated into the document, ensuring proper formatting and integrity. The article emphasizes the simplicity and flexibility of the process, allowing for tailored adjustments to suit various requirements. By following the document hierarchy (Document → Paragraph → Run → TextContent), users can efficiently apply text outlines and export the document. The article also includes a link to learn more about document elements with IronWord. ### Code Example: Add Text | IronWord https://ironsoftware.com/word/csharp/examples/add-text/ The article titled "Code Example: Add Text | IronWord" provides a comprehensive guide on how to add text to Word documents using IronWord in C#. It details the process, beginning with importing an existing Word document, then adding specific text, and finally exporting the modified document. The article includes corrected and enhanced code examples to ensure users can effectively implement the process. Additionally, it offers links to related documentation, a tutorial, a how-to guide, and class documentation to aid in understanding and applying the instructions. The page also provides resources such as downloading the IronWord DLL and a platform to report issues encountered during the process. This resource is aimed at users looking to manage and manipulate text content within Word files programmatically through C#. By following this guide, users can efficiently insert and handle text in their Word documents, leveraging the capabilities of IronWord to streamline document editing tasks. ### Code Example: Create Empty Word Document | IronWord https://ironsoftware.com/word/csharp/examples/create-empty-word/ The article "Code Example: Create Empty Word Document | IronWord" from Iron Software provides a detailed guide on creating Word and DOCX documents using the IronWord library. It outlines how to effortlessly instantiate a new Word document and structure it by adding sections, paragraphs, and tables. The process begins by importing necessary namespaces and creating a WordDocument object serving as the document's foundation. A new section is added using the AddSection method, allowing for separate formatting parts. Within this section, a paragraph can be created and text appended using the AddParagraph method. Furthermore, a 3x3 table is introduced into the section via the AddTable method, with text added to each cell through nested loops iterating over rows and columns. The final step involves saving the document as a .docx file using the SaveAs method, with a specified file name. The article also provides sample C# code demonstrating these steps, facilitating an easy understanding of document creation with IronWord. This guide is valuable for developers looking to automate document generation and structure using the IronWord library. ### Code Example: Create Word Document From Text | IronWord https://ironsoftware.com/word/csharp/examples/create-word-from-text/ The article titled "Code Example: Create Word Document From Text | IronWord" explains how to create a Word document from text using the IronWord library. It outlines a straightforward process where users can pass a document structure object, such as a paragraph, table, or section, to instantiate a new Word document. The document can then be exported using the SaveAs method. The article provides links to related documentation, tutorials, and how-to guides, available on GitHub, to assist users in effectively utilizing the IronWord library. Additionally, it offers options to download the necessary IronWord DLL and report any issues encountered. This resource is designed to help developers quickly and efficiently create DOCX/Word documents from text, ensuring a structured and professional output. The page encourages users to start creating documents instantly, highlighting the simplicity and effectiveness of the IronWord tool for Word document generation. ### Code Example: Edit Text | IronWord https://ironsoftware.com/word/csharp/examples/edit-text/ The tutorial on IronWord's "Edit Text" feature provides a detailed guide for developers looking to modify text within existing DOCX documents using C#. This functionality allows developers to make precise textual edits by accessing and manipulating the Paragraphs collection and specific Text objects within a document. This is particularly beneficial for scenarios requiring dynamic content updates, such as modifying reports, replacing placeholders, or editing text based on user input or data. By enabling granular text modifications, IronWord ensures that changes can be made without disrupting the document's overall structure or formatting. The tutorial outlines a five-step process: initializing a WordDocument object, loading the DOCX file, editing text in specified paragraphs, and saving the changes. The example code demonstrates editing text in specific paragraphs, highlighting how developers can update the first Text object in the first paragraph, the second Text object in the second paragraph, and the fourth Text object in the third paragraph. This feature is ideal for automated document generation workflows where frequent content updates are necessary. The tutorial also provides access to additional resources, such as sample codes, how-to guides, and related documentation. ### Code Example: Extract Text | IronWord https://ironsoftware.com/word/csharp/examples/extract-text/ The article titled "Code Example: Extract Text | IronWord" provides a detailed tutorial on efficiently extracting text from Word documents using the IronWord library for C#. It addresses the common challenges faced when dealing with large volumes of text, such as inefficiencies and time-consuming processes, especially with tables and numerous paragraphs. The IronWord's ExtractText method is introduced as a solution, offering a streamlined way to retrieve text without the need for cumbersome loops, thereby enhancing developer productivity. The tutorial exemplifies the use of the ExtractText method, demonstrating how to initialize the WordDocument class, which allows for loading and processing existing documents. This method simplifies the extraction of the entire document's text or specific portions, using the Paragraphs property to handle document sections individually. The article highlights the flexibility of the IronWord library, enabling developers to manipulate text extraction according to their needs by accessing specific paragraph indices or using C# array methods. This comprehensive guide ensures developers can maximize efficiency when working with Word documents, supported by links to related documentation and resources for further exploration. ### Code Example: Log Object Tree | IronWord https://ironsoftware.com/word/csharp/examples/log-object-tree/ The article titled "Code Example: Log Object Tree" on IronWord's website provides a comprehensive guide on how to inspect and log the object tree of a Word document using IronWord. Logging the object tree is a critical debugging tool that allows developers to gain valuable insights and verify the structure of Word documents during their construction. This process helps in quickly identifying and correcting errors or inconsistencies within the document's architecture. Furthermore, analyzing the object tree is beneficial for performance optimization as it enables developers to pinpoint and remedy inefficiencies in the document creation process. By facilitating a clearer understanding of the document's framework, logging the object tree significantly streamlines the development process, ensuring that developers can produce high-quality Word documents efficiently. The article also provides links to related documentation, tutorials, and guides, as well as resources for downloading the IronWord DLL and reporting issues, thereby offering a well-rounded resource for developers looking to enhance their debugging and document creation processes. ## Troubleshooting ### IronWord with DocumentFormat.OpenXml https://ironsoftware.com/word/csharp/troubleshooting/documentformat-openxml-conflict/ IronWord, when used in conjunction with `DocumentFormat.OpenXml`, can lead to a range of issues such as corrupted documents, incorrect formatting, or runtime errors, primarily caused by internal type and dependency mismatches between the two packages. Users frequently encounter exceptions like `System.InvalidOperationException` and `NullReferenceException` due to these conflicts. To address these problems, the article presents two solutions. The first solution is to pin the `DocumentFormat.OpenXml` package to version `2.8.1`, as it is the only version confirmed to coexist with IronWord without causing stability or output issues. The command to achieve this is `Install-Package DocumentFormat.OpenXml -Version 2.8.1`. The article clearly warns that any newer version of `DocumentFormat.OpenXml` is unsupported and could potentially disrupt IronWord’s functionality. The second solution is to entirely remove the `DocumentFormat.OpenXml` package if it is not critical to the project. By relying solely on IronWord, users can completely avoid the conflict, ensuring that their document processing operations remain stable and reliable. ### Engineering Request​ - IronWord https://ironsoftware.com/word/csharp/troubleshooting/engineering-request-word/ The "Engineering Request" page on IronSoftware's website provides guidance on submitting a technical support request for IronWord, a C# Word processing tool. The article emphasizes the importance of customer feedback in driving feature development and improvements, and outlines the process for reporting issues to the Iron Software engineering team. Key to effective communication is providing a detailed and reproducible description of the problem, akin to writing a Stack Overflow post. Essential elements of a support request include a clear symptom description, log files, and environmental details such as IronWord version, operating system, and .NET runtime version. To prioritize a ticket, users are encouraged to include an example project that reproduces the issue, along with code snippets, screenshots, exception messages, and detailed debugging information. For optimal issue replication, a standalone .NET console or web app project zipped and shared via Google Drive or Dropbox is recommended. This approach aids engineers in swiftly identifying and addressing the problem. Contact for support is directed to . Submitting comprehensive reports with these elements can expedite the resolution process, ensuring efficient troubleshooting and enhancement of the IronWord software. ### Header Disappears After SaveAs in IronWord https://ironsoftware.com/word/csharp/troubleshooting/header-disappears-after-saveas/ The article addresses an issue encountered in IronWord, where a DOCX template's header disappears after using the `SaveAs()` function. When placeholders in a template are merged and then saved using `SaveAs()`, the header, such as "City Attorney Cover Sheet", often vanishes in the generated document, despite correct placeholder merging. This problem was noted in IronWord version `2026.2.1` on a .NET 8 console application running Windows 11 Enterprise x64 (24H2). The recommended solution involves using `Save()` instead of `SaveAs()` to preserve the header. The procedure outlined includes loading the template with `WordDocument`, replacing placeholders using `doc.Texts`, and saving the file with `doc.Save(outputPath)`. The article advises users requiring `SaveAs()` to test the latest IronWord version to see if the header issue persists and suggests pinning to a previously successful version as a temporary fix if the problem reappears. It emphasizes the importance of verifying the header's presence post-save, as successful placeholder merging does not guarantee header retention. ### IronWord License in web.config | IronWord https://ironsoftware.com/word/csharp/troubleshooting/license-key-web.config/ The article from IronSoftware's website provides guidelines for resolving licensing issues in IronWord, particularly within ASP.NET projects and .NET Framework versions 4.6.2 and above. As of IronWord version 2024.3.5, these issues have been resolved, but for older versions, a workaround is necessary. The problem arises because the license key stored in the `Web.config` file is not automatically recognized by IronWord, leading to a licensing exception. The recommended solution involves manually retrieving the license key from the `Web.config` file using the `ConfigurationManager` class in the code and then applying it to the `License.LicenseKey` property. The article provides a detailed code example, demonstrating how to configure the `Web.config` file to store the license key and subsequently access and set it programmatically. This approach ensures that the license key is correctly applied, allowing for smooth deployment and operation of IronWord within affected project environments. ## Product Updates ### IronWord Latest Updates | IronWord https://ironsoftware.com/word/csharp/product-updates/changelog/ IronWord, a comprehensive Word document manipulation tool for C#, has seen multiple updates from its inception in January 2024 to June 2025. Initially released in January 2024, IronWord supports various platforms, including Windows, Linux, iOS, Android, Docker, Azure, and AWS. The updates focus on enhancing functionality and performance by addressing bugs, introducing new features, and upgrading dependencies. Notable updates include the introduction of text and paragraph styling in June 2024, the ability to set paper sizes and page orientations in March 2024, and methods for extracting and manipulating document content in May 2025. Version 2025.6.2, released in June 2025, primarily updates the Iron Software.System.Drawing dependency. The development of IronWord is heavily influenced by user feedback, which shapes its roadmap and feature prioritization. The tool aims to deliver a seamless experience in integrating Word document processing capabilities within .NET projects, ensuring reliability and performance. IronWord continues to evolve in alignment with developers' needs, maintaining a robust toolkit that enhances Word document processing in the .NET ecosystem.