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.
- Host: GitHub
- URL: https://github.com/deepakness/word2pdf
- Owner: deepakness
- License: mit
- Created: 2022-12-23T16:08:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-23T16:21:55.000Z (over 3 years ago)
- Last Synced: 2025-03-11T15:52:00.028Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 163 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.