.NET library for converting documents (Open XML, Office 97-2003, RTF, Markdown).
$ dotnet add package DocSharp.Binary.CommonDocSharp is a pure C# library to convert between document formats without Office interop or native dependencies.
The following packages are currently available:
The optional extra packages DocSharp.ImageSharp and DocSharp.SystemDrawing allow to convert unsupported images (e.g. GIF / TIFF for DOCX -> RTF or WMF / EMF / TIFF for DOCX -> MD).
There is no common DOM to manipulate or generate documents, this library is mainly for conversion. Some helper methods on top of the Open XML SDK and format-specific writers are available, but they are mostly intended for internal use.
A new simplified DOM and RTF import are being worked on in a separate branch, but I can't guarantee when/if it will be ready.
For now, you can consider the following libraries for documents creation and manipulation: OfficeIMO, OpenXML-Office, ClosedXML, ShapeCrawler, QuestPDF, MigraDoc.
.NET 6, 8, 9 and .NET Framework 4.6.2 and higher are supported, but tests are mostly performed on .NET 8 and above.
You can refer to the project Wiki or sample app.
Dependencies:
Forked:
Others:
DocSharp is licensed under MIT license and can be used for both open source and commercial projects.
DocSharp.ImageSharp is licensed under Apache 2.0 license; ImageSharp and VectSharp have their own licenses, please visit their repositories for more information.
If you find the library useful, adding a star is highly appreciated, stars are a way to guide other developers towards helpful libraries and tools.