Docx Writer
The Docx Writer component lets you turn plain text or markdown into a Microsoft Word (.docx) file right inside your Nappai dashboard. Just give it a file name and the content you want, and it will generate a downloadable Word document for you.
How it Works
When you run the component, it takes the text you provide (either plain text or markdown) and converts it into a Word document. The conversion happens locally on your machine, so no external services are called. The component packages the resulting file as a base‑64 encoded string and returns it as a Data object that can be used by other components in your workflow.
Inputs
- File Content: The text or markdown that will become the body of the Word document. This input is required and can accept plain text, Data objects, or Message objects.
- File Name: The name you want to give the generated file. If you leave this blank, a default name will be used.
Outputs
- File: A Data object that contains the generated Word document. The data is base‑64 encoded and includes metadata such as the file name, MIME type, and encoding. You can pass this output to other components that need to store, send, or further process the document.
Usage Example
- Drag the Docx Writer component onto your workflow canvas.
- Connect a Text or Markdown component to the File Content input.
- (Optional) Connect a Text component that outputs the desired file name to the File Name input.
- Connect the File output to a File Storage or Email component to save or send the document.
- Run the workflow – a Word file will be created and available for download or further use.
Related Components
- PDF Writer – Convert text or markdown into a PDF file.
- Text Writer – Save plain text to a .txt file.
- File Storage – Store generated files in cloud or local storage.
- Email Sender – Attach generated files to outgoing emails.
Tips and Best Practices
- Use markdown syntax in File Content to add headings, lists, and formatting to your Word document.
- Keep the file name short and avoid special characters to ensure compatibility across operating systems.
- If you need the file to be stored permanently, pipe the File output to a File Storage component.
- For large documents, consider splitting the content into smaller chunks and merging them before writing.
Security Considerations
- The component runs locally and does not send data to external services, so your content stays on your machine.
- The generated file is base‑64 encoded, which is safe for transport in JSON or other data pipelines.
- Be mindful of the file size; very large documents may consume significant memory during conversion.