|
| 1 | +# DocumentFormat.OpenXml.Extensions |
| 2 | + |
| 3 | +[中文](README_zh-cn.md)|[English](README.md) |
| 4 | + |
| 5 | +OpenXML SDK 的扩展集,包括扩展库和辅助开发工具 |
| 6 | + |
| 7 | +| Build | |
| 8 | +|--| |
| 9 | +|| |
| 10 | + |
| 11 | +# 工具 |
| 12 | + |
| 13 | +## dotnetCampus.OfficeDocumentZipper |
| 14 | + |
| 15 | +[解压缩文档为文件夹工具](https://blog.lindexi.com/post/dotnet-OpenXML-%E8%A7%A3%E5%8E%8B%E7%BC%A9%E6%96%87%E6%A1%A3%E4%B8%BA%E6%96%87%E4%BB%B6%E5%A4%B9%E5%B7%A5%E5%85%B7.html) |
| 16 | + |
| 17 | +在开发过程中,需要不断解压缩 Office 文档,阅读或修改文档的内容,再次压缩回 Office 文档,这样的效率比较低。本工具提供一键解压自动格式化,一键组装Office文档且打开的功能 |
| 18 | + |
| 19 | +### 使用方法 |
| 20 | + |
| 21 | +OfficeDocumentZipper 工具作为 dotnet tool 发布,可使用以下代码进行安装和启动 |
| 22 | + |
| 23 | +``` |
| 24 | +dotnet tool update -g dotnetCampus.OfficeDocumentZipper |
| 25 | +
|
| 26 | +OfficeDocumentZipper |
| 27 | +``` |
| 28 | + |
| 29 | +建议将以上命令存放作为 bat 脚本,方便每次快速运行 |
| 30 | + |
| 31 | +### 功能 |
| 32 | + |
| 33 | +- 解压 pptx docx xlsx 文件以及自动格式化文档内容 |
| 34 | +- 压缩文件夹作为 pptx docx xlsx 文件 |
| 35 | +- 转换 OpenXML 单位 |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +# 库 |
| 40 | + |
| 41 | +| Name | NuGet| |
| 42 | +|--|--| |
| 43 | +|dotnetCampus.OpenXMLUnitConverter|[](https://www.nuget.org/packages/dotnetCampus.OpenXMLUnitConverter)| |
| 44 | +|dotnetCampus.OpenXMLUnitConverter.Source|[](https://www.nuget.org/packages/dotnetCampus.OpenXMLUnitConverter.Source)| |
| 45 | + |
| 46 | + |
| 47 | +## dotnetCampus.OpenXMLUnitConverter |
| 48 | + |
| 49 | +定义 OpenXML 的单位以及提供单位转换的功能 |
| 50 | + |
| 51 | +### 安装方法 |
| 52 | + |
| 53 | +DLL 包: |
| 54 | + |
| 55 | +```xml |
| 56 | +<PackageReference Include="dotnetCampus.OpenXmlUnitConverter" Version="1.8.0" /> |
| 57 | +``` |
| 58 | + |
| 59 | +[SouceYard](https://github.com/dotnet-campus/SourceYard) 源代码包: |
| 60 | + |
| 61 | +```xml |
| 62 | +<PackageReference Include="dotnetCampus.OpenXmlUnitConverter.Source" Version="1.8.0"> |
| 63 | + <PrivateAssets>all</PrivateAssets> |
| 64 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
| 65 | +</PackageReference> |
| 66 | +``` |
| 67 | + |
| 68 | +### 使用方法 |
| 69 | + |
| 70 | +例子: |
| 71 | + |
| 72 | +```csharp |
| 73 | +void Foo(DocumentFormat.OpenXml.Drawing.Point2DType point) |
| 74 | +{ |
| 75 | + var x = new Emu(point.X); |
| 76 | + var pixelValue = x.ToPixel(); |
| 77 | + var cmValue = x.ToCm(); |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +详细请看 [Office Open XML 的测量单位](https://blog.lindexi.com/post/Office-Open-XML-%E7%9A%84%E6%B5%8B%E9%87%8F%E5%8D%95%E4%BD%8D.html ) |
0 commit comments