DocD.Handlers
2.0.2
dotnet add package DocD.Handlers --version 2.0.2
NuGet\Install-Package DocD.Handlers -Version 2.0.2
<PackageReference Include="DocD.Handlers" Version="2.0.2" />
<PackageVersion Include="DocD.Handlers" Version="2.0.2" />
<PackageReference Include="DocD.Handlers" />
paket add DocD.Handlers --version 2.0.2
#r "nuget: DocD.Handlers, 2.0.2"
#:package DocD.Handlers@2.0.2
#addin nuget:?package=DocD.Handlers&version=2.0.2
#tool nuget:?package=DocD.Handlers&version=2.0.2
DocD.Handlers
A .NET 8 library for processing and generating various document types including insurance denials, settlement releases, and letters using Microsoft Word templates.
Overview
DocD.Handlers provides a comprehensive set of document processing capabilities for insurance-related documents. The library uses the FreeSpire.Office suite to manipulate Word documents and supports mail merge operations, template processing, and automated document generation.
Features
Document Type Support:
- Insurance denial letters (insured and claimant)
- Settlement release documents
- Standard business letters
Template Processing:
- Word template loading and processing
- Mail merge field handling
- Dynamic content insertion
- Bookmark-based content replacement
Advanced Features:
- Automatic signature block insertion
- Address formatting and insertion
- Settlement amount conversion to written form
- Class code integration
- Exclusions and definitions management
- Additional insured party handling
Formatting:
- Consistent Calibri 11pt font application
- Table formatting support
- Custom signature styling (Brush Script MT)
Installation
dotnet add package DocD.Handlers
Dependencies
- .NET 8.0
- FreeSpire.Office 8.2.0
- Humanizer 2.14.1
- Newtonsoft.Json 13.0.3
- System.Text.Json 9.0.8
- System.Security.Cryptography packages
Usage
Basic Document Generation
using DocD.Handlers.DocumentHandlers;
using DocD.Handlers.Dtos;
using DocD.Handlers.Models;
using Spire.Doc;
// Create a new document instance
var document = new Document();
// Create user information
var user = new User
{
EmployeeName = "John Doe",
JobTitle = "Claims Adjuster",
Email = "john.doe@company.com",
PhoneNumber = "555-123-4567"
};
// Create template information
var template = new TemplateStoreDto
{
Filename = "path/to/template.docx",
Title = "Standard Letter Template"
};
Generating a Standard Letter
var letterData = new LetterDataDto
{
ClaimNumber = "CLM-2024-001",
MergeFieldProperties = new List<MergeFieldProperty>
{
new() { FieldName = "CompanyName", FieldValue = "ABC Insurance" },
new() { FieldName = "Date", FieldValue = DateTime.Now.ToString("MMMM dd, yyyy") }
},
MailToAddress = "123 Main St\nAnytown, ST 12345",
CcAddress = "456 Oak Ave\nOther City, ST 67890"
};
var generatedDocument = document.BuildStandardLetter(letterData, template, user);
Generating a Denial Letter
var denialData = new DenialDataDto
{
MergeFieldProperties = new List<MergeFieldProperty>
{
new() { FieldName = "Insured Insurance Carrier_Gen", FieldValue = "" },
new() { FieldName = "Carrier Initials_Gen", FieldValue = "FWCI" },
new() { FieldName = "PolicyNumber", FieldValue = "POL-123456" }
},
InsuredAddress = "789 Business Blvd\nBusiness City, ST 11111",
ClaimantAddress = "321 Residential Dr\nHome Town, ST 22222",
IsSubContractorInvolved = false
};
var definitions = new List<Definition>();
var exclusions = new List<Exclusions>();
var classCodes = "[]"; // JSON string of class codes
var denialDocument = document.BuildInsuredDenialLetterAsync(
denialData, template, user, definitions, exclusions, classCodes);
Generating a Release Document
var releaseData = new ReleaseDataDto
{
MergeFieldProperties = new List<MergeFieldProperty>
{
new() { FieldName = "Settlement Amount", FieldValue = "5000.00" },
new() { FieldName = "ClaimantName", FieldValue = "Jane Smith" },
new() { FieldName = "_AdditionalParty1", FieldValue = "Party Name" }
}
};
var releaseDocument = document.BuildRelease(releaseData, template, user);
Key Components
Document Extensions
DenialExtensions: Handles insurance denial letter generation with support for exclusions, definitions, and class codesReleaseExtensions: Processes settlement release documents with automatic settlement amount conversionLetterExtensions: Manages standard business letter creation with signature blocks and address formatting
Data Models
DocumentDataBase: Base class for all document dataUser: User information for signatures and contact detailsMergeFieldProperty: Key-value pairs for mail merge operationsTemplateStoreDto: Template file information and metadata
Special Features
Settlement Amount Processing
The library automatically converts numeric settlement amounts to written form:
5000.00becomesFive Thousand and 00/100 Dollars
Additional Insured Handling
Merge fields starting with underscore (_) are automatically processed as additional insured parties and combined into a single field.
Signature Integration
Documents support both signature blocks (contact information) and signature lines (styled employee names).
Template Requirements
Templates should be Microsoft Word documents (.docx) with:
- Mail merge fields in the format
<<FieldName>> - Bookmarks for special content areas:
[SignatureBlock]- For employee contact information[Signature]- For styled signature[Address]- For recipient address[ccAddress]- For CC addressDefinitions- For definition insertionsExclusions- For exclusion contentFriendlyNames- For simplified exclusion descriptionsClassCodes- For class code listings
License
This software is licensed under a custom license agreement. See the included LICENSE.md file for complete terms and conditions.
Author
Timothy Jones
Copyright � 2025 Tim Jones. All rights reserved.
Version
Current version: 1.0.8
What's New (1.0.8)
- Documentation updates and clarifications for template bookmarks and merge-field usage.
- Minor wording fixes in README and USAGE.md.
- No API or breaking changes; fully compatible with .NET 8.
Support
This package is designed for internal business use and includes functionality specific to insurance document processing workflows.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FreeSpire.Office (>= 8.2.0)
- Humanizer (>= 2.14.1)
- System.Formats.Asn1 (>= 9.0.8)
- System.Security.Cryptography.Pkcs (>= 9.0.8)
- System.Security.Cryptography.Xml (>= 9.0.8)
- System.Text.Json (>= 9.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|