Aspose.Words CHM File Processor for .NET

Aspose.Words CHM File Processor for .NET enables developers to create, load, edit, and manage CHM (Compiled HTML Help) files directly within .NET applications. With a rich object model for handling help topics, tables of contents, indexes, and embedded resources, this plugin is essential for CHM workflows. Since Aspose.Words does not natively save to CHM, the processor is used together with the Converter plugin and format-specific plugins (e.g., PDF, DOCX, HTML) for export.

Installation and Setup

  1. Install the NuGet package Aspose.Words CHM File Processor in your project.
  2. Apply metered licensing at application startup ( Metered Licensing Guide ).
  3. For complete CHM creation and export, reference both this plugin and the Converter plugin. See the Installation Guide .

Supported Platforms:

  • OS: Windows, Linux, macOS
  • Frameworks: .NET Framework (2.0–4.8), .NET Standard, .NET Core (2.0–3.1), .NET 5/6+, Mono
  • IDEs: Visual Studio (2010–2022), Xamarin, MonoDevelop

Quick Start: Load and Read CHM Files

using Aspose.Words;

// Load CHM file
doc = new Document(MyDir + "HTML help.chm");

// Save to DOCX (requires Converter plugin)
doc.Save(ArtifactsDir + "ProcessorChmPlugin.ReadChm.docx");

ℹ️ The CHM File Processor supports reading and editing CHM, while saving requires pairing with Converter and export plugins.

Features and Functionalities

1. Loading and Parsing CHM Files

  • Read CHM archives from streams or disk paths.
  • Access help topics as HTML fragments with embedded styles and scripts.
  • Extract resources (images, CSS, JS) for reuse.
  • Preserve table of contents, index, and metadata.

2. Creating CHM Projects

  • Start a blank CHM with metadata (title, default topic).
  • Configure output properties: window size, language, default help window.
  • Initialize collections for topics, resources, and index entries.

3. Topic & HTML Content Management

  • Add, reorder, or remove topics programmatically.
  • Insert/edit HTML with custom styles, scripts, or DOM manipulation.
  • Full encoding support (UTF-8, UTF-16, code pages).

4. Table of Contents (TOC) Authoring

  • Build hierarchical TOC entries mapped to topics.
  • Manage captions, nesting, and visibility.
  • Keep TOC synced with topic collection.

5. Index Management

  • Create index entries linked to topics or anchors.
  • Define primary/secondary keywords and sort orders.
  • Import/export index definitions for team workflows.

6. Resource Handling

  • Embed CSS, images, JavaScript, and custom binaries.
  • Manage resource references inside HTML.
  • Replace or extract resources without full rebuild.

7. Hyperlinks & Bookmarks

  • Insert internal/external links to topics, anchors, or URLs.
  • Manage bookmarks for detailed navigation.
  • Ensure cross-topic linking consistency.

8. Help Window Customization

  • Configure help window (size, toolbars, menus).
  • Set home topic, default navigation tab, fonts, and color schemes.
  • Personalize navigation pane and toolbar icons.

9. Integration with Converter Plugin

  • Pass in-memory CHM projects to Aspose.Words Document Converter for packaging.
  • Export CHM content into DOCX, PDF, EPUB, HTML, and more.
  • Enable hybrid workflows like CHM ➝ DOCX ➝ PDF.

Best Practices

  • Dispose resources promptly to avoid file locks.
  • Use in-memory streams in CI/CD for efficiency.
  • Batch updates before saving to improve performance.
  • Keep HTML content lean for smaller CHM sizes.
  • Test multilingual content across viewers.
  • Use consistent naming for topics/bookmarks.
  • Log errors for diagnosing malformed CHM archives.
  • Split very large CHM projects to optimize memory use.

Addressing Common Challenges

Slow loading of large CHMs ✔ Use asynchronous programming in .NET to improve load times.

Difficulty extracting images/tables ✔ Use Document.GetChildNodes or DOM APIs to manipulate structures.

Frequently Asked Questions

Q: What is Aspose.Words CHM File Processor for .NET? A plugin to import, create, and edit CHM files programmatically, with export enabled through Converter plugins.

Q: What file formats can CHM be converted to? With the Converter plugin, CHM can be saved to DOCX, PDF, HTML, EPUB, and more.

Q: Does it support automation workflows? Yes, CHM File Processor integrates with Aspose.Words and Converter plugins for automated pipelines.

Q: Can I manage CHM indexes and TOC? Yes, it provides APIs for building and editing hierarchical TOC and index entries.

Q: What are the benefits of this plugin? It streamlines CHM editing, reduces reliance on manual tools, and integrates with existing .NET workflows.