An open API service indexing awesome lists of open source software.

https://github.com/deepakness/word2pdf

word2pdf helps you converts multiple Word files (.doc and .docx) to PDFs.
https://github.com/deepakness/word2pdf

Last synced: 3 months ago
JSON representation

word2pdf helps you converts multiple Word files (.doc and .docx) to PDFs.

Awesome Lists containing this project

README

          

# word2pdf

Bulk convert Word files (`.doc` and `.docx`) to PDFs using [docx2pdf](https://pypi.org/project/docx2pdf/).

## Improvements in this version

- Command-line interface for custom input/output folders.
- Optional recursive scan of subdirectories.
- Safe default behavior that skips already converted PDFs.
- `--overwrite` flag to replace existing PDFs when needed.
- `--dry-run` mode to preview conversion without writing output.
- Conversion summary at the end.

## Install

```bash
python -m pip install docx2pdf
```

## Usage

### Basic usage (same defaults as before)

```bash
python word2pdf.py
```

Defaults:

- Input directory: `word`
- Output directory: `pdfs`

### Custom folders

```bash
python word2pdf.py --input /path/to/word/files --output /path/to/pdfs
```

### Recursive conversion

```bash
python word2pdf.py --recursive
```

### Overwrite existing PDFs

```bash
python word2pdf.py --overwrite
```

### Preview only (no files written)

```bash
python word2pdf.py --dry-run
```

`--dry-run` works even if `docx2pdf` is not installed, since no conversion is executed.

## Notes

- `docx2pdf` relies on Microsoft Word on Windows/macOS and is not fully functional on Linux in many environments.
- Relative folder structure is preserved in output when `--recursive` is used.