在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:evidenceprime/html-docx-js开源软件地址:https://github.com/evidenceprime/html-docx-js开源编程语言:JavaScript 95.9%开源软件介绍:html-docx-jsThis is a very small library that is capable of converting HTML documents to DOCX format that is used by Microsoft Word 2007 and onward. It manages to perform the conversion in the browser by using a feature called 'altchunks'. In a nutshell, it allows embedding content in a different markup language. We are using MHT document to ship the embedded content to Word as it allows to handle images. After Word opens such file, it converts the external content to Word Processing ML (this is how the markup language of DOCX files is called) and replaces the reference. Altchunks were not supported by Microsoft Word for Mac 2008 and are not supported by LibreOffice and Google Docs. CompatibilityThis library should work on any modern browser that supports It also works on Node.js (tested on v0.10.12) using Images SupportThis library supports only inlined base64 images (sourced via DATA URI). But it is easy to convert a
regular image (sourced from static folder) on the fly. If you need an example of such conversion you can checkout a demo page source (see function Usage and demoVery minimal demo is available as You can also find a sample for using it in Node.js environment here. To generate DOCX, simply pass a HTML document (as string) to
For example:
IMPORTANT: please pass a complete, valid HTML (including DOCTYPE,
LicenseCopyright (c) 2015 Evidence Prime, Inc. See the LICENSE file for license rights and limitations (MIT). |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论