allorion-exporting-html-to-docx v1.2.0
Allorion Exporting HTML to DOCX
Описание
allorion-exporting-html-to-docx
— это мощный npm-модуль, предназначенный для работы в браузере. Он предоставляет возможность конвертирования HTML-контента в документы формата DOCX, сохраняя их структуру и форматирование.
Инициализация
Для использования модуля необходимо приобрести лицензию. Для получения ключа лицензии и подписи обратитесь в Telegram @a11ori или на email buy@allorion.ru.
Пример инициализации модуля:
const license = {
licenseKey: 'licenseKey',
signature: 'signature',
};
export const exportHtmlToDocx = await initializeModule(license);
Использование
После успешной авторизации можно воспользоваться функцией exportHtmlToDocx
:
exportHtmlToDocx({
fileName: 'nameFile',
divId: 'id-div-blok',
format: 'A4',
orientation: 'vertical'
}).then((flag) => {
console.log(flag);
});
// Или
const flag = await exportHtmlToDocx({
fileName: 'nameFile',
divId: 'id-div-blok',
format: 'A4',
orientation: 'vertical'
});
API
exportHtmlToDocx({ fileName, jsxElement, format, orientation, divId }: IExportingHtmlToDocx) => Promise<boolean>
fileName
— имя создаваемого файла.divId
— ID HTML-элемента, содержащего данные для экспорта.jsxElement
— если необходимо передать JSX-код напрямую.format
— размер страницы (поддерживаются A1, A2, A3, A4).orientation
— ориентация страницы (vertical или landscape).
Поддерживаемые HTML-теги
<h1>
,<h2>
,<h3>
…<h6>
<p>
,<span>
<br>
<ul>
,<ol>
,<li>
<table>
,<tr>
,<td>
,<th>
<figure>
Лицензия
См. файл LICENSE.
Allorion Exporting HTML to DOCX (English)
Description
allorion-exporting-html-to-docx
is a powerful npm module designed for browser environments. It enables seamless conversion of HTML content into DOCX documents while preserving their structure and formatting.
Initialization
To use this module, a license is required. To obtain a license key and signature, contact Telegram @a11ori or email buy@allorion.ru.
Example module initialization:
const license = {
licenseKey: 'licenseKey',
signature: 'signature',
};
export const exportHtmlToDocx = await initializeModule(license);
Usage
Once authenticated, you can use exportHtmlToDocx
:
exportHtmlToDocx({
fileName: 'nameFile',
divId: 'id-div-block',
format: 'A4',
orientation: 'vertical'
}).then((flag) => {
console.log(flag);
});
// Or
const flag = await exportHtmlToDocx({
fileName: 'nameFile',
divId: 'id-div-block',
format: 'A4',
orientation: 'vertical'
});
API
exportHtmlToDocx({ fileName, jsxElement, format, orientation, divId }: IExportingHtmlToDocx) => Promise<boolean>
fileName
— Name of the exported file.divId
— ID of the HTML element containing the data to export.jsxElement
— Direct JSX input if required.format
— Page size (supports A1, A2, A3, A4).orientation
— Page orientation (vertical or landscape).
Supported HTML Tags
<h1>
,<h2>
,<h3>
…<h6>
<p>
,<span>
<br>
<ul>
,<ol>
,<li>
<table>
,<tr>
,<td>
,<th>
<figure>
License
Refer to the LICENSE file.