This Gist repository contains C# code snippets that correspond to the How-To Articles chapter of the Aspose.HTML for .NET documentation. These small examples are practical, ready-to-use code snippets that demonstrate common tasks and advanced techniques for working with HTML documents using Aspose.HTML for .NET.
These gists are practical solutions to popular questions, including:
- How to Change Text Color – Apply CSS or inline styles to modify the appearance of text.
- How to Change Background Color – Customize background styles using internal CSS or inline attributes.
- How to Change Border Color – Add borders to elements using CSS or inline attributes.
- How to Add an Image to HTML – Insert images into existing documents programmatically.
- How to Use CSS Selectors – Select and manipulate elements using
QuerySelector()andQuerySelectorAll(). - How to Use XPath Queries – Use the
Evaluate()method to locate and extract nodes based on XPath expressions. - How to Set a Custom Font Folder – Configure the font directory to influence rendering in PDF or image conversion.
- How to Serialize Form Input Values – Capture and process user input values from form elements.
- How to Check for Empty HTML Content – Verify whether the document body contains any text.
Each gist is designed to be self-contained and executable. To get the most out of them:
- Install Aspose.HTML for .NET via NuGet.
- Clone or download the repository.
- Configure paths, settings, and inputs to suit your environment.
- Run your project to see the example in action.
Detailed explanations and full context for each example can be found in the How-To Articles sections of the official documentation.
Aspose.HTML for .NET is a powerful .NET library for parsing, modifying, and converting HTML and HTML-related formats (SVG, MHTML, XHTML, Markdown, EPUB). It provides built-in support for CSS, JavaScript, DOM traversal, XPath, document save options, and more.
If you have questions or suggestions related to these examples, please use the Aspose.HTML Support Forum to get help or share feedback.