Outsystems Forge provides a large set of reusable assets that help accelerate application delivery. These assets are made available by our community uses and by Outsystems.
When searching CreateDocxFromHtml in Outsystems Forge.
Overview
The CreateDocxFromHtml extension allows developers to generate .docx files dynamically from HTML content. The extension writes the generated .docx file to a specified location on the server. After the file is created, it can be read and downloaded using the appropriate OutSystems actions.
How It Works
FilePath: Full path and filename (e.g., C:\Files\GeneratedDocument.docx).
HtmlContent: The HTML source string to be converted into a .docx file.
A .docx file is created at the specified location.
Use the File_ReadBinary action to read the generated file into binary format.
Serve the binary content to the end user as a downloadable file.
For downloading, use the MIME type:application/vnd.openxmlformats-officedocument.wordprocessingml.document.
How to Use
FilePath: Path with filename where the document should be created.
HtmlContent: HTML source to be converted.
Example Usage
FilePath: C:\Files\Document.docx
HtmlContent:
html
Copy code
<html>
<body>
<h1>Hello, World!</h1>
<p>This is a sample document generated from HTML.</p>
</body>
</html>
A .docx file containing:
css
Hello, World!
This is a sample document generated from HTML.
Common Issues
File Path Not Accessible:Ensure that the server has write permissions to the specified location.
Invalid HTML Content:The HTML source should be well-formed. Ensure that all tags are properly closed.
Dependencies
OutSystems Platform.
File System Permissions (to create and read files).
Additional Notes
This extension is suitable for scenarios like report generation, exporting rich-text content, or creating dynamic documents in an OutSystems application.
License adherence: Ensure that external libraries (like the Microsoft Excel Package) comply with their respective licensing terms.
Up-to-date with OutSystems version: Ensure the extension is compatible with the latest version of OutSystems.
Active support: Be responsive to user feedback, resolve reported issues promptly, and provide updates.
Documentation updates: Keep the extension's documentation current with any new features or changes.