Docx To Content
ai-research-agent / extractor/url-to-content/docx-to-content
Extract
convertDOCXToHTML()
function convertDOCXToHTML(input: string | ArrayBuffer | File | Blob, options?: DocxOptions): Promise<string>;Defined in: src/extractor/url-to-content/docx-to-content.js:54
Converts a DOCX document to HTML
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| DOCX input to convert |
| Conversion options |
Returns
Promise<string>
The converted HTML
Throws
If conversion fails
Example
const html = await convertDOCXToHTML('https://example.com/doc.docx');
const html = await convertDOCXToHTML(fileInput.files[0]);Other
DocxOptions
Defined in: src/extractor/url-to-content/docx-to-content.js:5
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
| Base path for image resources | ||
| Whether to include document styles | ||
| Whether to preserve shape elements |
ParagraphStyle
Defined in: src/extractor/url-to-content/docx-to-content.js:220
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
| Text alignment (left, right, center, justify) | ||
| Paragraph indentation | ||
| Keep with next paragraph | ||
| Force page break before | ||
| Line spacing |
RunStyle
Defined in: src/extractor/url-to-content/docx-to-content.js:229
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
| Bold text | ||
| Text color | ||
| Font family | ||
| Highlight color | ||
| Italic text | ||
| Font size | ||
| Underlined text |
StyleConfig
Defined in: src/extractor/url-to-content/docx-to-content.js:13
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
| If true, element is rendered as block | ||
| CSS class name | ||
| HTML element name | ||
| If true, element is a heading | ||
| DOCX XML element name |