This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Loads a Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Traverses paragraphs and displays associated styles as defined by the Word document template. | |
/// Traverses through each run (text fragment) within each paragraph and displays fragment values. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document to load is present | |
/// (default is the root of your project). | |
/// </param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Loads a Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Modifies paragraphs by prepending 'Modified Heading :' for styled paragraphs | |
/// and 'Modified Run :' for each run within normal paragraphs, preserving the existing format. | |
/// Saves the modified Word Document. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document to load is present and | |
/// the modified document will be saved (default is the the root of your project). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates a new Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Loads images from the specified diretory and decodes using SkiaSharp. | |
/// Creates a word document, appends loaded images and then saves the word document. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document will be saved (default is root of your project). | |
/// </param> | |
/// <param name="imageDirectory"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Loads a Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Traverses images and displays image metadata. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document to load is present (default is root of your project). | |
/// </param> | |
/// <param name="filename"> | |
/// The name of the Word Document file to load (default is "WordImages.docx"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Loads a Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Gets images from the word document. Decodes image using SkiaSharp and encode to JPG. | |
/// Resize image to 250(height) and 200(width). | |
/// Saves the modified Word Document. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document to load is present and | |
/// the modified document will be saved (default is root of your project). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Loads a Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Traverses tables and displays associated styles as defined by the Word document template. | |
/// Traverses through each row and then traverses columns within the row. | |
/// Traverses through paragrpahs within each cell and displays paragraph plain text | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document to load is present | |
/// (default is root of your project). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Loads a Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Modifies tables by setting column widths to 2000 | |
/// Saves the modified Word Document. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document to load is present and | |
/// the modified document will be saved (default is root of your project). | |
/// </param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Concurrently updating three documents using <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a> | |
// Supported in v23.12.0 | |
var task1 = System.Threading.Tasks.Task.Run(() | |
=> ManipulateDocument("doc1.docx", "doc1_Threaded.docx")); | |
var task2 = System.Threading.Tasks.Task.Run(() | |
=> ManipulateDocument("doc2.docx", "doc2_Threaded.docx")); | |
var task3 = System.Threading.Tasks.Task.Run(() | |
=> ManipulateDocument("doc3.docx", "doc3_Threaded.docx")); | |
// Wait for all tasks to complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates a new Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Generates paragraphs with heading styles defined by the Word document template. | |
/// Adds normal paragraphs under each heading paragraph, including text runs with various fonts as per the template. | |
/// Saves the newly created Word Document. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document will be saved (default is the root of your project). | |
/// </param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates a new Word Document with structured content using | |
/// <a href="https://www.nuget.org/packages/FileFormat.Words">FileFormat.Words</a>. | |
/// Generates 5(rows) x 3(cols) tables with table styles defined by the Word document template. | |
/// Appends each table to the body of the word document. | |
/// Saves the newly created word document. | |
/// </summary> | |
/// <param name="documentDirectory"> | |
/// The directory where the Word Document will be saved (default is root of your project). | |
/// </param> |
OlderNewer