# DCWriterLite
**Repository Path**: anysharp/DCWriterLite
## Basic Information
- **Project Name**: DCWriterLite
- **Description**: 是一个基于 .NET 开源、功能强大的在线文档编辑器,与 TinyMCE 和 CKEditor 等基于浏览器的 HTML DOM 开发的其他软件不同,DCWriterLite 构建自己的 DOM 结构,使用 XML 存储文档,并使用 Canvas 进行文档渲染,使用 SVG 进行文档打印。先进的文档编辑功能,例如实时分页、可靠的重做/撤消功能和强大的表单字段。
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: https://www.cnblogs.com/Can-daydayup/p/19063391
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2025-09-03
- **Last Updated**: 2025-09-09
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# DCWriterLite
August 18, 2025
Author : yongfu-yuan(袁永福,MS MVP
) from CHINA .
Email : [yyf9989@hotmail.com](mailto:yyf9989@hotmail.com)
Site : [https://dcwriter.cn/](https://dcwriter.cn/).
Online demo : [https://dcsoft-yyf.github.io/DCWriterLite/index.html](https://dcsoft-yyf.github.io/DCWriterLite/index.html).
# Update log
2025-8-18 : First publish.
2025-8-26 : Update readme.
2025-8-31 : Update readme.
---
DCWriterLite is an open-source structured document editor similar to RTF, which can benefit many different groups of people:
## For C# Developers
It demonstrates the following amazing programming techniques:
1. Utilizing `System.Drawing.Graphics` and `System.Windows.Forms.Control` types in Blazor WebAssembly development. This helps developers migrate a large amount of C# code that would otherwise be discarded to WASM development, protecting the industry's investments in related fields.
2. It implements a complete DOM model in the most concise way possible, making it easy to learn and understand. While [Open Office](https://www.openoffice.org/) also defines a similar DOM model, but it contains tens of millions of lines of source code, which exceeds the comprehension ability of most individuals or teams.
3. This project shows how to trimming the Blazor WebAssembly framework. This helps developers understand part of the underlying principles of Blazor WebAssembly, reduce the size of the final software file (dotnet.wasm), and improve software loading speed.
## For B2B Developers
1. It provides distinctive structured document functions. It supports free text input and also offers form areas to restrict the input methods for specific regions.
2. It implements a custom DOM model, which provides unlimited extensibility. Developers can create new document element types based on this, making the software more in line with specific business requirements. For example, developers can use it to build template creation tools to dynamically define various complex form interfaces required for user business.
3. Instead of being based on HTML DOM, DCWriterLite implements its own document **layout** algorithm, which breaks through some technical limitations of HTML DOM. For instance, it achieves a reliable Undo/Redo function and ensures completely consistent **layout** results across different browsers.
4. It uses XML format for storage, featuring a simple structure. This allows developers to easily develop backend programs to process millions of documents in batches without calling the DCWriterLite software module.
## For Web Developers
DCWriterLite offers the following user-friendly features:
1. It is a pure front-end component that does not depend on third-party components and supports mainstream browsers such as Chrome and Firefox.
2. It supports real-time pagination, full WYSIWYG (What You See Is What You Get) functionality, achieves completely consistent typesetting effects across different browsers, and offers reliable Undo/Redo operations.
3. It supports multiple operating systems including Windows, Linux, Mac, Android, and iOS.
4. It provides a very concise API (Application Programming Interface) that allows for easy implementation of the multi-document mode with pagination tabs.
# For Electronic Medical Record Developers
DCWriterLite offers very professional features related to clinical medical documentation:
1. Structured medical record documentation functionality.
2. Capable of implementing medical record front pages, admission records, nursing records, progress notes, surgical records, informed consent forms, discharge summaries, examination reports, and imaging reports.
3. The commercial version also provides writing trace retention, multi-level permission control, and various medical expressions such as dental charts and menstrual history. It can also automatically calculate the scores of rating scales.
4. In China, this editor software is already running in at least 50,000 hospitals, and it is estimated that 500,000 doctors use the software every day to write more than 10 million pages of medical records.
5. [Function Demo Video: AI Assists Doctors in Writing Medical Records - 1](https://www.facebook.com/chinanjyyf.chinanjyyf.5/videos/748334408177464)
6. [Function Demo Video: AI Assists Doctors in Writing Medical Records - 2](https://www.facebook.com/chinanjyyf.chinanjyyf.5/videos/1716579789030019)
## For Chinese Developers
DCWriterLite has passed the official certification of domestic operating systems such as Kylin, Foundersoft, and Tongxin, complying with the requirements of the Xin Chuang.
## For End Users
DCWriterLite provides simple yet powerful document editing functions:
1. It offers a user experience similar to MS Word, allowing users to get started without learning.
2. It supports accurate real-time pagination, realizes the What-You-See-Is-What-You-Get (WYSIWYG) function, and enables unlimited Undo/Redo operations, helping users achieve their goals quickly.
3. It provides multiple functions such as tables and header table rows, facilitating the rapid creation of documents with complex **layout**.
## Applicable Application Scenarios
1. Structured Electronic Medical Record (EMR) Systems: Assisting doctors in writing medical record homepages, admission records, progress notes, inspection and test reports, nursing records, patient informed consent forms, discharge records, etc.
2. Government Electronic Official Document Systems: Helping users define various official documents and dynamically adjust the content and status of official documents according to business processes.
3. Financial Business Compliance Document Processing: Its unique structured document technology makes it easier for the system to extract key data from documents for inspection and maintenance.
4. Manufacturing Industry Form Systems: Enabling the rapid definition of complex form input interfaces, helping the manufacturing industry input various complex node data one by one, and facilitating quick reading and analysis by the backend.
# Screen snapshort
You want this ?
But this is DCWriter Business Edition, please learn about [[the DCWriter Business Edition]](https://github.com/dcsoft-yyf/DCWriterLite/blob/main/README-be.md) .
# DCWriterLite Open Source Edition Feature List
## Operating Environment
- Supports Windows, Linux, MacOS, iOS, Android, UOS, Kylin, Fde, and other operating systems.
- Supports Chrome, Firefox, and other browsers.
- Pure front-end components, does not rely on server-side, and does not depend on any third-party components.
## File Operations:
- Create new file
- Open files, supports XML formats.
- Save files, supports XML formats.
- Print settings
- Paper type
- Paper orientation
- Margin settings for top, bottom, left, and right
- Global document grid lines
- Print preview
## Copy and Paste
- Supports copying and pasting of plain text and private format document content
## Redo/Undo
- Supports unlimited redo and undo operations
## Text Styles
- Supports bold, italic, underline, strikethrough, font name, and font size settings
- Borders and background colors for text, input fields, and cells
## Rulers
- Supports horizontal and vertical rulers.
- Supports setting margins by dragging the ruler scales.
- Supports setting paragraph margins by dragging the ruler scales.
## Paragraph Styles
- Supports line spacing and paragraph spacing
## Programmable DOM API Interface
Provides a tree-like DOM model to represent all the content in the document. And provides the following DOM document element types.
- XTextDocument Document element
- Represents the root node of the document and is the entry point for DOM tree operations.
- XTextContainerElement Container element, an abstract class, the base class for all container elements.
- Can contain other elements.
- XTextImageElement Image element
- Can freely drag to set the size of the image
- Only supports JPG, PNG, BMP formats.
- XTextInputFieldElement Input field element
- Input field highlighted display
- Set background text
- Content validation, including required fields, maximum value, minimum value, etc.
- XTextLineBreakElement Line break element
- Text performs a soft return but does not apply paragraph spacing settings.
- XTextPageBreakElement Page break element
- Can cause forced page breaks
- XTextPageInfoElement Page number element
- Can display page numbers or total page numbers
- XTextParagraphFlagElement Paragraph flag element
- Can be set as the first-line indent of a paragraph
- Can be set as the hanging indent of a paragraph
- Can be set as the alignment of a paragraph (left, center, right, justified)
- Can set the line spacing and paragraph spacing of a paragraph
- Can set numbered lists and bullet lists
- XTextTableElement Table element
- Table header row
- Merge and split cells
- Set the height of table rows and the width of table columns by dragging with the mouse
- Set forced page breaks for table rows
- Set table rows as non-cross-page (cannot be split by page breaks)
- XTextCheckBoxElement/XTextRadioElement Check box/Radio button element
- Can be set as selected state - Can be set to non-editable status
- Can be set to required status
- Multi-line text
If you want more features and services, please learn about [[the DCWriter Business Edition]](https://github.com/dcsoft-yyf/DCWriterLite/blob/main/README-be.md)) .
---
DCWriterLite是一个开源的类似RTF的结构化文档编辑器,许多不同的人群都能从中获益:
# 对于C#开发者
它展示了以下神奇的编程技巧
1. 在Blazor Webassembly编程中使用System.Drawing.Graphics和System.Windows.Forms.Control类型。这能帮助开发者将大量原本要抛弃的C#代码移植到WASM开发中,保护业界在相关领域的投资。
2. 它以尽可能精炼的方式实现了一套完整的D OM模型,很容易学习领会。而Open Office也定义了类似的DOM模型,但它包含了上千万行代码,超出了绝大多数人或团队的理解能力。
3. 这个项目展示了如何精简Blazor Wassembly框架。这能帮助开发者理解Blazor Wassembly的部分底层原理,并能减少最终的软件文件(dotnet.wasm)大小,提高软件加载速度。
# 对于toB的开发者
1. DCWriterLite提供了特色的结构化文书功能。它提供自由文本录入的功能,同时还能提供表单区域来限制特定区域的录入方式。
2. DCWriterLite实现了自定义的DOM模型,这就提供了无限的扩展能力。开发者可以据此创建新的文档元素类型,使得软件更符合具体业务需求。比如开发者可以用它来开发模板制作工具,来动态定义用户业务所需的各种复杂的表单界面。
3. DCWriterLite不是基于HTML DOM,而是自行实现了文档排版算法,这就突破了HTML DOM的一些技术限制。比如实现了可靠的Undo/Redo功能,而且在不同的浏览器间保持完全一致的排版结果。
4. DCWriterLite采用XML格式进行存储,结构简单。这就使得开发者可以很容易开发出后台程序来批量处理数百万份文档而不必调用DCWriterLite软件模块。
# 对于Web开发者
DCWriterLite提供以下令人舒服的特性:
1. 它是一个纯前端的组件,不依赖于第三方组件,支持Chrome和Firefox等主流浏览器。
2. 支持实时分页,完全的所见即所得,在不同的浏览器呈现完全一致的排版效果,可靠的Undo/Redo操作。
3. 支持Windows、Linux、Mac、安卓、iOS等多种操作系统。
4. 它提供很简洁的API编程接口,可以很方便的实现分页标签多文档模式。
# 对于电子病历开发者
DCWriterLite提供非常专业的临床医疗文书的相关功能:
1. 结构化病历文书功能。
2. 可以实现病案首页,入院记录,护理记录,病程记录,手术记录,知情同意书,出院记录,检查报告,影像报告单。
3. 商业版还提供书写痕迹保留,多级权限控制,多种医学表达式,比如牙位图,月经史等等。并能自动计算评分量表分值。
4. 在中国,已经有至少5万家医院运行着这个编辑器软件,估计每天有50万个医生使用该软件书写了超过1000万页的病历文档。
5. [功能演示视频:AI帮助医生写病历-1](https://www.facebook.com/chinanjyyf.chinanjyyf.5/videos/748334408177464)
6. [功能演示视频:AI帮助医生写病历-2](https://www.facebook.com/chinanjyyf.chinanjyyf.5/videos/1716579789030019)
# 对于中国开发者
DCWriterLite通过了国产的麒麟、方德、统信操作系统的原厂认证,符合信创规则。
# 对于最终使用者
DCWriterLite提供了简约而不简单的文档编辑功能:
1. 它提供类似MS Word的用户体验,用户无需学习即可上手使用。
2. 它能进行精确的实时分页,实现了所见即所得的功能,无限制的Undo/Redo操作,帮助用户快速达成目标。
3. 提供表格、标题表格行等多项功能,可以快速创建复杂排版的文档。
# 能胜任的应用场景
1. 结构化电子病历系统:帮助医生书写病案首页、入院记录、病程记录、检查检验报告单、护理记录、患者知情同意书、出院记录等等等。
2. 政府电子公文系统:帮助用户定义各种公文,并根据业务流程动态的调整公文内容和状态。
3. 金融业务合规文档处理:它特有的结构化文档技术,使得系统更方便的从中抽取关键数据进行检查和维护。
4. 制造业表单系统:可以快速定义复杂的表单录入界面,帮助制造业将各种复杂的节点数据逐一录入,方便后台快速读取和分析。
# DCWriter商业版
您若想要更多的功能和服务,请了解[【DCWriter商业版】](https://github.com/dcsoft-yyf/DCWriterLite/blob/main/README-be.md).
# DCWriterLite 开源版功能清单
## 运行环境
- 支持Windows、Linux、MacOS、iOS、安卓、统信、麒麟、方德等操作系统。
- 支持Chrome、Firefox等浏览器。
- 纯前端组件,不依赖服务器端,不依赖任何第三方组件。
## 文件操作:
- 新建文件
- 打开文件,支持XML格式。
- 保存文件,支持XML格式。
- 打印设置
- 纸张类型
- 纸张方向
- 上下左右的边距设置
- 全局性文档网格线
- 打印预览
## 复制粘贴
- 支持纯文本、私有格式的文档内容的复制粘贴
## 重做/撤销
- 支持不限制次数的重做和撤销操作
## 文本样式
- 支持粗体、斜体、下划线、删除线、字体名称、字体大小的设置
- 文本、输入域、单元格的边框和背景色。
## 标尺
- 支持横向和纵向标尺。
- 支持拖拽标尺的刻度来设置页边距。
- 支持拖拽标尺的刻度来设置段落边距。
## 段落样式
- 支持行间距和段落间距
## 可编程DOM API接口
提供树状的DOM模型,用于表示文档中所有的内容。并提供以下DOM文档元素类型。
- XTextDocument 文档元素
- 表示文档根节点,是DOM树的操作的入口点。
- XTextContainerElement 容器元素,是一个抽象类,是所有容器元素的基类。
- 可以包含其他元素。
- XTextImageElement 图片元素
- 可以自由拖拽设置图片的大小
- 只支持JPG\PNG\BMP格式。
- XTextInputFieldElement 输入域元素
- 输入域高亮度显示
- 设置背景文本
- 内容校验,包括必填项、最大值、最小值等。
- XTextLineBreakElement 换行元素
- 文本进行软回车,但不应用段落间距的设置。
- XTextPageBreakElement 分页元素
- 可以导致强制分页
- XTextPageInfoElement 页码元素
- 可以显示页码或者总页数
- XTextParagraphFlagElement 段落标记元素
- 可以设置为段落的首行缩进
- 可以设置为段落的悬挂缩进
- 可以设置为段落的对齐方式(靠左、居中、靠右、两端对齐)
- 可以设置段落的行间距和段落间距
- 可以设置数字列表和项目符号列表
- XTextTableElement表格元素
- 表格标题行
- 合并拆分单元格
- 鼠标拖拽来设置表格行的高度和表格列的宽度
- 表格行设置强制分页
- 表格行设置为不可跨页(不能被分页线分割)
- XTextCheckBoxElement/XTextRadioElement 单选框/单选按钮元素
- 可以设置为选中状态
- 可以设置为不可编辑状态
- 可以设置为必填状态
- 文本多行
# Donate 捐助
You can donate by paypal , by alipay ,
by Wechat,help author to feed twins born in 2020.