Why to Convert
The DOTX format is a Microsoft Office Open XML template file used for creating documents. It is a file format used to store documents and is based on the Open XML standard. It is used to create documents such as letters, reports, and other documents. However, the DOTX format is not compatible with many other applications and platforms. Therefore, it is necessary to convert DOTX to other formats such as JSON in order to make the documents accessible to other applications and platforms.
How Aspose.Total helps for dotx to json conversion
Aspose.Total for C++ is a suite of APIs that enables developers to easily convert DOTX to JSON format within their C++ applications. It consists of Aspose.Words for C++, Aspose.Cells for C++, and other APIs. Aspose.Words for C++ can be used to export DOTX to HTML format. After that, Aspose.Cells for C++ can be used to convert HTML to JSON format. This makes it easy for developers to convert DOTX to JSON format within their C++ applications.
Convert DOTX to JSON Format via C++
Get Started with C++ File Automation APIs
Install via Package Manager Console of Visual Studio with Install-Package Aspose.Total.Cpp
.
Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads .
// supports DOC, DOT, DOCX, DOCM, DOTX, DOTM, RTF, WordML, MOBI, ODT, and OTT file formats | |
// load DOCX as input file format with an instance of Document class | |
auto doc = MakeObject<Document>(u"Input.docx"); | |
// save document in HTML format | |
doc->Save(u"Output.html"); | |
// Load the HTML. | |
intrusive_ptr<Aspose::Cells::IWorkbook> wkb = Factory::CreateIWorkbook(u"Output.html"); | |
// Save in JSON format. | |
wkb->Save(u"Output.json", SaveFormat_Json); |
Convert Protected DOTX to JSON Format via C++
Using the API, you can also open the password-protected document. If your input DOTX document is password protected, you cannot convert it to JSON format without using the password. To do this, use a special constructor overload, which accepts a LoadOptions object. This object contains the Password property, which specifies the password string.
// supports DOC, DOT, DOCX, DOCM, DOTX, DOTM, RTF, WordML, MOBI, ODT, and OTT file formats | |
// Loads encrypted document. | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"LoadEncrypted.docx", System::MakeObject<LoadOptions>(u"aspose")); | |
// save document in HTML format | |
doc->Save(u"Output.html"); | |
// Load the HTML. | |
intrusive_ptr<Aspose::Cells::IWorkbook> wkb = Factory::CreateIWorkbook(u"Output.html"); | |
// Save in JSON format. | |
wkb->Save(u"Output.json", SaveFormat_Json); |