Download the source and code to convert the word docx file to html with #c C#
This article is a solution to that problem and also helps C# developers to do Docx-HTML-Docx conversion. The resources found in this article have been collected from various places and solutions provided by many great developers around the world and combined into a small sample application so that developers don't have to look for solutions to common problems.
Sample image at runtime
- DocumentFormat.OpenXml.dll (184.108.40.206) [To convert Docx to Html]
- DocumentFormat.OpenXml.dll (2.5.5631.0) [To convert Html to Docx]
- We actually didn't have to add two different sets of the same DLL, but it was forced due to some DLL issues.
- System.IO.Packaging.dll (220.127.116.11)
- HtmlToOpenXml (18.104.22.168)
- System.Drawing[افزودن مرجع]
- System.IO.Compression[افزودن مرجع]
- CKEditor (Standard 4.6.1) - Your choice
توجه: You can also find the DLLs mentioned above in the project I have attached with this article.
Docx to HTML has become a very common requirement these days, mainly if you have or are building a CMS and your WYSIWYG editor wants this feature. Also, if you noticed, you can find many questions about converting Docx to Html on StackOverflow.
This editor on which I wrote my article also has its Paste from Word button. It would be much better if it had the ability to directly upload the docx file next to it. I hope this feature will be available in all WYSIWYG editors soon.
Moving on to what this article intends to do, as shown in the figure below:
Well, if you didn't know what a Docx file is, then it's a packaged file just like our regular zip file with its own set of standardized structures. If you try to decompress a docx file with a decompressor or a zip extractor.
Dear user, you are offered a download