---
Product: Aspose.Words
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/words/python/ldmdocxwriter
---

# LdmDocxWriter

## Overview

`LdmDocxWriter` is a class in Aspose.Words FOSS for Python.

Convert an :class:`ldm.Document` into a DOCX file.

This class declares 3 methods for LdmDocxWriter objects in Python programs.
Available methods include: `__init__`, `write`, `write_to_bytes`.
Public members are accessible to any Python application after installing the Aspose.Words FOSS for Python package.
Properties: `options`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `options` | - | Read | Gets the options. |

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__(options: Optional[object])` | Calls __init__(options) on this LdmDocxWriter instance. |
| `write(doc: ldm.Document, output_path: Union[str, Path])` | Render ``doc`` and write the resulting ``.docx`` to disk. |
| `write_to_bytes(doc: ldm.Document)` → `bytes` | Render ``doc`` and return the ``.docx`` as raw bytes. |

## See Also

- [Aspose.Words for Python — Enterprise API Reference](https://reference.aspose.com/words/python-net/)