IronWord, crafted by Iron Software, is a robust library empowering C# developers with tools to manipulate, create, and store Word documents in .NET applications and websites.
- Manipulating, creating, and storing Word and DOCX files.
- PageSetup: Customizing paper size, page orientation, margins, and background color.
- TextRun: Managing text elements, styles, appending text, splitting, and integrating images.
- TextStyle: Overseeing font type, size, color, boldness, italics, strikethrough, underlining, superscript, and subscript functionalities.
- Paragraph: Incorporating text runs, images, shapes, aligning texts, and configuring bullets and numbering.
- Table: Adjusting tables by adding rows, setting cell content, removing rows, merging cells, etc.
- Image: Embedding images from files or streams, adjusting text wrapping, positioning, dimensions, and other characteristics.
- Shape: Modifying text wrapping, positioning, dimensions, type of shapes, and rotation.
Explore more! Head to our homepage for detailed code samples and a comprehensive features list
- .NET 8, .NET 7, .NET 6, and .NET 5, Core 2x & 3x, Standard 2, and Framework 4.6.2+
- Systems like Windows, macOS, Linux, Docker, Azure, and AWS
Visit our site for the API document reference and information on licenses.
To initiate, install the IronWord NuGet package using the following command in your package manager console:
PM> Install-Package IronWord
When installed, incorporate using IronWord;
at the start of your C# scripts. Below is an illustrative example to assist with opening, modifying, and storing a document:
using IronWord;
using IronWord.Models;
using IronSoftware.Drawing;
// Load an existing Word document
var docxCurrent = new WordDocument("existing.docx");
// Or initiate a new Word document
var docxNew = new WordDocument();
// Creating a new paragraph with custom text
Paragraph newParagraph = new Paragraph();
var textContent = new Text()
{
Text = "Welcome to IronWord!"
};
newParagraph.AddText(textContent);
docxCurrent.AddParagraph(newParagraph);
// Including an image within a paragraph
Image newImage = new Image("example.jpg");
newImage.Width = 200; // Specify width in pixels
newImage.Height = 200; // Specify height in pixels
newParagraph = new Paragraph();
// Add the image
newParagraph.AddImage(newImage);
docxCurrent.AddParagraph(newParagraph);
// Overwrite the existing document
docxCurrent.Save("existing.docx");
// Alternatively, save as a new document
docxCurrent.SaveAs("output.docx");
Explore our extensive code examples, tutorials, licensing details, and documentation.
For any assistance, contact us via email at: [email protected]
- How-To Guides: https://ironsoftware.com/csharp/word/how-to/
- API Examples: https://ironsoftware.com/csharp/word/examples/
- API Reference: https://ironsoftware.com/csharp/word/object-reference/api/
- Tutorials: https://ironsoftware.com/csharp/word/tutorials/
- Licensing Details: https://ironsoftware.com/csharp/word/licensing/
- Live Chat Support: https://ironsoftware.com/csharp/word/#helpscout-support