Metadata-Version: 2.4
Name: anyconv-document-basic
Version: 1.0.1
Summary: AnyConv basic document module: PDF, DOC, DOCX, ODT, RTF, PPT, PPTX and ODP
Author: AnyConv
License-Expression: MIT
Keywords: anyconv,documents,pdf,docx,pptx,libreoffice,images
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyconv-core<2.0,>=1.0
Requires-Dist: python-docx>=1.1
Requires-Dist: python-pptx>=0.6
Requires-Dist: pypdfium2<5,>=4.30
Requires-Dist: Pillow>=10.0
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Dynamic: license-file

# anyconv-document-basic

Документы и презентации AnyConv: PDF, DOC, DOCX, ODT, RTF, PPT, PPTX, ODP.

## Возможности

- **`word-convert`** — DOC, DOCX, ODT, RTF → PDF, DOCX, ODT, RTF.
- **`presentation-convert`** — PPT, PPTX, ODP → PDF, PPTX, ODP.
- **`document-extract-text`** — PDF и офисные документы → `text:plain`.
- **`document-render-pages`** — PDF и офисные документы → набор PNG-страниц
  (например, PPTX → изображения слайдов). Результат отдается ZIP-архивом в сайте.
- **`text-document-convert`** — прямая вставка обычного текста или Markdown → PDF, DOCX.
- **`document-markup-convert`** — PDF/DOCX/DOC/ODT/RTF → HTML или Markdown.
- **`document-render-pages`** поддерживает `pages` — выбранный диапазон страниц.
- **`document-markup-convert`** — PDF/DOCX/DOC/ODT/RTF → HTML или Markdown.

## Зависимости

- LibreOffice (`soffice`) для офисных форматов; PDF-текст и PDF-страницы работают
  без него.
- Python-пакеты `python-docx`, `python-pptx`, `pypdfium2`, `Pillow`.

Путь к LibreOffice можно указать в конфигурации модуля:

```yaml
modules:
  config:
    com.gitlab.raceozr.document-basic:
      soffice_path: /usr/bin/soffice
```

## Настройки

| Возможность | Настройка | По умолчанию | Описание |
|---|---|---|---|
| `document-extract-text` | `page_breaks` | `true` | Разделять страницы форм-фидом |
| `document-extract-text` | `include_notes` | `true` | Добавлять заметки презентации |
| `document-render-pages` | `dpi` | `144` | Разрешение PNG-страниц, 72–300 |

## Установка и проверка

```bash
pip install "anyconv-core[all] @ git+https://gitlab.com/raceozr/anyconv-core.git@v1.0.0"
pip install "git+https://gitlab.com/raceozr/anyconv-modules.git@v1.0.1#subdirectory=modules/document-basic"
# ?????????? ?? checkout anyconv-modules
cd modules/document-basic
pip install -e ".[dev]"
pytest
anyconv module validate .
anyconv module test .
```
