Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AllConv — PDF ⇄ HTML ⇄ Markdown Converter

An all-to-all document converter for PDF, HTML and Markdown on Linux. Written in Python. Comes with both a command-line tool and a simple GUI. Install it once and just type allconv from anywhere.


Table of contents

  1. What it does
  2. Requirements
  3. Quick start (no install)
  4. Install into your Linux system (type allconv anywhere)
  5. Command-line usage
  6. GUI usage
  7. Use it as a Python library
  8. How it works
  9. Project layout
  10. Troubleshooting
  11. Uninstall
  12. License

1. What it does

AllConv converts between the three formats in every direction:

From ↓ / To → PDF HTML Markdown
PDF
HTML
Markdown

That's all 6 conversions: pdf→md, pdf→html, html→md, html→pdf, md→html, md→pdf.

Formats are detected automatically from file extensions, so most of the time you just give it an input and an output file.


2. Requirements

  • Python 3.9+ (developed and tested on 3.13)
  • pip (python3 -m pip)
  • For the GUI only: Tkinter
    Distro Install command
    Debian / Ubuntu / Mint sudo apt install python3-tk
    Fedora / RHEL / CentOS sudo dnf install python3-tkinter
    Arch / Manjaro sudo pacman -S tk
    openSUSE sudo zypper install python3-tk

Everything else is installed automatically from requirements.txt.


3. Quick start (no install)

Use it straight from the unzipped folder without installing anything system-wide:

unzip allconv.zip
cd allconv
python3 -m pip install -r requirements.txt

# run the CLI
python3 -m allconv.cli report.pdf report.md

# run the GUI
python3 -m allconv.gui

There are also convenience scripts:

./run_cli.sh report.pdf report.md
./run_gui.sh

4. Install into your Linux system

Yes — you can install it so that typing allconv works from any folder. There are two ways.

Option A — One-command installer (recommended, easiest)

From inside the unzipped allconv folder:

chmod +x install.sh
./install.sh

This will:

  • install the Python dependencies,
  • copy the app to ~/.local/share/allconv,
  • create the allconv command (and allconv-gui) in ~/.local/bin,
  • add “AllConv” to your application menu (so you can launch the GUI by clicking).

Works on every Linux distribution — not just Debian/Ubuntu. The installer only uses python3 + pip and the standard ~/.local directories that every distro has. The one distro-specific piece (installing Tkinter for the GUI) is auto-detected for apt, dnf, yum, pacman, zypper, apk, xbps, eopkg, emerge and nix, and the installer prints the exact command for your system. To let it install Tkinter automatically (via sudo), run:

./install.sh --with-tk

Then you can run it from anywhere:

allconv report.pdf report.md
allconv --gui

PATH note: the command lives in ~/.local/bin. On most distros this is already on your PATH. If typing allconv says command not found, add this line to ~/.bashrc (or ~/.zshrc) and reopen the terminal:

export PATH="$HOME/.local/bin:$PATH"

The installer tells you if this step is needed.

Option B — Install as a proper Python package (pip)

This uses the packaging in pyproject.toml and also gives you the allconv command:

cd allconv
python3 -m pip install --user .

# optional extras:
python3 -m pip install --user ".[pdf]"       # WeasyPrint = nicest PDF output
python3 -m pip install --user ".[extract]"   # markitdown = better PDF -> Markdown

Now allconv is available system-wide (again via ~/.local/bin).

Tip — fully isolated install with pipx:

pipx install .

pipx keeps AllConv and its dependencies in their own environment while still putting the allconv command on your PATH. Install pipx with python3 -m pip install --user pipx if you don't have it.


5. Command-line usage

# formats auto-detected from extensions
allconv report.pdf report.md          # PDF      -> Markdown
allconv report.pdf report.html        # PDF      -> HTML
allconv page.html  page.md            # HTML     -> Markdown
allconv page.html  page.pdf           # HTML     -> PDF
allconv notes.md   notes.html         # Markdown -> HTML
allconv notes.md   notes.pdf          # Markdown -> PDF

# force formats explicitly (useful for odd extensions)
allconv data.txt out.pdf --from md --to pdf

# helpful commands
allconv --list        # show every supported conversion
allconv --help        # full help
allconv --version     # print version
allconv --gui         # open the graphical interface

Exit codes: 0 success · 2 input missing · 3 conversion error · 4 unexpected error. (Useful when calling AllConv from your own shell scripts.)

Batch example (convert a whole folder)

# convert every Markdown file in the current folder to PDF
for f in *.md; do allconv "$f" "${f%.md}.pdf"; done

6. GUI usage

Launch it in any of these ways:

allconv --gui          # if installed
allconv-gui            # if installed (Option A)
python3 -m allconv.gui # from the source folder
./run_gui.sh           # from the source folder

or click AllConv in your application menu (after running install.sh).

Then:

  1. Click Browse… and pick a PDF / HTML / Markdown file.
  2. Choose the target format (PDF / HTML / Markdown).
  3. Click Convert and choose where to save.

The source format is detected automatically. A progress bar shows while it works, and it tells you where the file was saved.


7. Use it as a Python library

from allconv import convert_file, convert

# file-to-file (formats inferred from extensions)
convert_file("report.pdf", "report.md")

# in-memory conversions
html = convert("# Hello\n\nWorld", "md", "html")   # returns a str
pdf_bytes = convert(html, "html", "pdf")            # returns bytes
with open("out.pdf", "wb") as f:
    f.write(pdf_bytes)

Public API: convert, convert_file, detect_format, SUPPORTED_FORMATS, CONVERSIONS, ConversionError.


8. How it works

Conversion Engine used
HTML → Markdown markdownify (falls back to BeautifulSoup text)
Markdown → HTML markdown (falls back to a built-in mini-parser)
PDF → HTML PyMuPDF positioned HTML
PDF → Markdown markitdown if present, else PyMuPDF heading heuristics
HTML → PDF WeasyPrint → headless Chromium → ReportLab (text)
Markdown → PDF Markdown → HTML → PDF (same engine chain as above)

PDF output is automatic: AllConv picks the best engine available on your system, so you don't have to configure anything. Install WeasyPrint for the nicest results; otherwise it uses Chromium/Chrome if present, and finally a plain-text PDF fallback that always works.


9. Project layout

allconv/
├── allconv/
│   ├── __init__.py      # public API
│   ├── converters.py    # core engine (all 6 conversions + fallbacks)
│   ├── cli.py           # command-line interface
│   └── gui.py           # Tkinter GUI
├── install.sh           # system-wide installer (creates the `allconv` command)
├── uninstall.sh         # remove the installed command
├── requirements.txt     # Python dependencies
├── pyproject.toml       # installable package + `allconv` entry point
├── run_cli.sh           # run CLI without installing
├── run_gui.sh           # run GUI without installing
├── tests/sample.md      # example file to try
└── README.md            # this file

10. Troubleshooting

allconv: command not found Your ~/.local/bin isn't on PATH. Add this to ~/.bashrc and reopen the terminal:

export PATH="$HOME/.local/bin:$PATH"

GUI won't start / No module named tkinter Install Tkinter for your distro (see Requirements).

PDF output looks plain / unstyled You're on the text fallback. Install a real engine:

python3 -m pip install --user weasyprint

or make sure chromium / google-chrome is installed and on your PATH.

PDF → Markdown gives empty or garbled text The PDF is probably a scanned image. Extracting text from scans needs OCR (e.g. tesseract), which is not built in.

Dependencies didn't install (no internet during install.sh) Run it again with internet, or manually:

python3 -m pip install --user -r requirements.txt

11. Uninstall

./uninstall.sh

This removes the allconv / allconv-gui commands, the menu entry, and the installed app files. (If you installed via pip: python3 -m pip uninstall allconv.)


12. License

MIT — free to use, modify and share.

About

An all-to-all document converter for PDF, HTML and Markdown on Linux. Written in Python. Comes with both a command-line tool and a simple GUI. Install it once and just type allconv from anywhere.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages