Convert Word Doc To html And html To Word Doc
10 March 2021
In one of our recent projects, we faced the need to convert files (.docx, .doc and .rtf) to html and vice versa. Writing your own solution from the beginning would be heroic and probably unprofitable. The ASPOSE tool resolved the case.
What is ASPOSE?
ASPOSE is an advanced document processing API. It supports generating, modifying and converting files without the use of other systems directly in the application. Part of ASPOSE.Words supports all the popular formats and conversion between them and export to fixed formats such as .pdf.
More about ASPOSE can be found at https://www.aspose.com/.
Description of the use case
Implementation of a system for handling and managing offers and applications announced as a part of competitions and calls for proposals.
On the basis of the Administrator’s decision, a Call for Proposals for public entities or a Competition for Offers for non-public Bidders is announced. The application/offer should then be submitted in electronic and paper form within the time limit specified by the Administrator. The application/offer is subject to formal and substantive assessment. The administrator concludes an agreement with the Applicant/Bidder. The content of the contract includes an obligation to perform specific activities, the time and financial framework of the project, as well as reporting conditions.
For the documents listed below, an electronic form is required, so that it will be possible to process the matter online:
- Formal evaluation criteria,
- Substantive evaluation criteria,
- Application / offer,
- Formal evaluation sheet,
- Substantive assessment sheet,
- Change form,
- Agreement,
- Annex,
- Report,
- Cost estimate.
One of the requirements of the system was the conversion of the document from .docx to html and from html to .docx, which would enable the use of the WYSIWYG editor to update documents dynamically.
How did we come across ASPOSE
After researching the market and opportunities, we did not find a solution as comprehensive as ASPOSE. Some of the tools we tried to use require the installation of additional software, such as miktex or office.
ASPOSE gives you the opportunity to take advantage of a free trial version and obtain a temporary license that allows you to verify the full capabilities of the API. Below is an example of using a trial version to generate a formal evaluation card.
To try out the ASPOSE.Word version, go to: https://downloads.aspose.com/words/net.
Use in practice
We use ASPOSE.Words for .NET to generate and convert documents to the following formats:
- docx > pdf,
- docx > html,
- html > docx,
- docx > rtf
Below is an example of docx > html conversion to edit a document in a WYSIWYG editor. The user can enter tags that define parameters in the system.
From html, the document is converted to .docx with the following call:
For comparison, we have prepared the implementation of the same functionality using a different available solution. There is a significant difference between the examples in terms of the complexity of the application code. The implementation of generating and converting documents using ASPOSE is much friendlier for the developer.
Summary
ASPOSE met the expectations of the project. Thanks to the use of API, we were able to generate and convert documents without any problems. We have not found such a comprehensive solution on the market that will certainly be used in the implementation of other projects.