# string.markdown.toDocx 库模块帮助文档

[» 使用指南](https://www.aardio.com/zh-cn/docs/library/string/markdown/toDocx/index.html) [» 调用范例](https://www.aardio.com/zh-cn/docs/examples/Text/Markdown/md2docx.html)

## string.markdown.toDocx 成员列表 <a id="string.markdown.toDocx" href="#string.markdown.toDocx">&#x23;</a>

原生 Markdown → DOCX 文档。  
不需要安装 Office，生成过程不调用 Office / COM / .NET。  
支持 Markdown 输出的 HTML 子集，不是通用网页排版引擎。

### string.markdown.toDocx.defaults <a id="string.markdown.toDocx.defaults" href="#string.markdown.toDocx.defaults">&#x23;</a>
默认选项（与 string.html.toDocx.defaults 共用）。  
font / monoFont / symbolFont；fontSize / codeFontSize（磅）；lineSpacing；  
pageWidth / pageHeight / margins（twips）；landscape；checkboxStyle="unicode"或"ascii"；  
wideTable="stack"或"wrap"；tableMinColumnWidth；colors（0xRRGGBB）；title / author；overwrite。

### string.markdown.toDocx.save(path,markdown,options) <a id="string.markdown.toDocx.save" href="#string.markdown.toDocx.save">&#x23;</a>
直接保存为 DOCX，成功返回完整路径,null,report；失败返回 null,err。  
自动创建目录，默认不覆盖；options.overwrite=true 允许原子替换已有文件。

## string.markdown 成员列表 <a id="string.markdown" href="#string.markdown">&#x23;</a>

### string.markdown.toDocx(markdown,options) <a id="string.markdown.toDocx" href="#string.markdown.toDocx">&#x23;</a>
返回 DOCX 二进制字符串,err,report。  
成功 err 为 null；report.warnings 为降级提示数组。  
可用 string.save 保存二进制，推荐使用 save 方法。  
options 与 string.html.toDocx 相同。  
标题、文本格式、代码、列表、任务复选框、引用、链接、普通表格。  
图片暂保留替代文字和地址，不下载；不嵌入字体，不转换完整数学公式。
