Skip to main content

Full-page HTML/URL to PNG or PDF renderer — CLI + drag-and-drop GUI

Project description

HTML RenderFriend

Full-page PNG screenshots from HTML files and URLs — CLI + drag-and-drop GUI


Install

pip install html-renderfriend
playwright install chromium

That's it.


Quick start

# CLI
htmlrf https://example.com -o example.png
htmlrf "C:\MyPages\report.html" -o report.png --width 1440

# GUI
htmlrf-gui

Features

Feature CLI GUI
Remote URLs (http/https)
Local .html / .htm files
Paste raw HTML directly
Drag-and-drop from Explorer
Configurable viewport width
Retina 2× output (deviceScaleFactor)
Full-page scroll capture
Timestamped log pane
Dark / light theme toggle
Open output folder in Explorer

CLI reference

htmlrf <input> [options]
Flag Default Description
input (required) URL or path to .html / .htm file
-o / --output screenshot.png Output PNG path
-w / --width 1920 Viewport width: 1280, 1440, 1920, 2560

GUI

Launch with htmlrf-gui. Three input methods:

Method How
Drag and drop Drag any .html file from Windows Explorer onto the drop zone
URL / path Type or paste into the entry field on the "Drop / URL" tab
Paste HTML Switch to the "Paste HTML" tab, paste raw markup, click Screenshot

Shortcuts: Ctrl+S screenshot · Ctrl+D paste clipboard as source · Esc quit

Output defaults to Desktop/screenshot_<timestamp>.png. Use Save As… to pin a fixed path.


How it works

Playwright launches a headless Chromium instance, navigates to the target, waits for JS and resources to settle, then captures the full scrollable page height as PNG. Static converters that skip JS-driven layout produce different results.


Alternative install (from source)

git clone https://github.com/bra-khet/html-renderfriend.git
cd html-renderfriend
python -m venv venv
venv\Scripts\activate
pip install -e .
playwright install chromium

Requires Python 3.11+.


Building a standalone EXE

pip install pyinstaller
pip install -e .
pyinstaller --onefile --windowed --name htmlrf src/htmlrf/gui.py

dist\htmlrf.exe bundles everything except Chromium, which Playwright downloads on first run.


Project structure

html-renderfriend/
├── src/
│   └── htmlrf/
│       ├── __init__.py
│       ├── screenshot.py    # Core renderer + take_full_screenshot()
│       └── gui.py           # Drag-and-drop GUI (CustomTkinter + TkinterDnD2)
├── tests/
├── pyproject.toml
├── setup.bat
├── screenshot.bat
├── gui.bat
├── .gitignore
├── LICENSE
└── README.md

Roadmap

  • Batch processing from a URL list file
  • PDF export alongside PNG
  • Configurable wait conditions and CSS injection
  • GitHub Actions CI for cross-platform testing

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html_renderfriend-2.2.0.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

html_renderfriend-2.2.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file html_renderfriend-2.2.0.tar.gz.

File metadata

  • Download URL: html_renderfriend-2.2.0.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for html_renderfriend-2.2.0.tar.gz
Algorithm Hash digest
SHA256 f26b0f7ffd2c1fed39dbf32feedeedf556fcb162b24674f54457f8a5a3b984c4
MD5 70ef88cb52ef0d2d8baa003ccae09713
BLAKE2b-256 088a08484e4887493a6940bc088072b213faf2b0f88131a3146cbf6e30fb27d2

See more details on using hashes here.

File details

Details for the file html_renderfriend-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for html_renderfriend-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b729d2d8538c7111092f877de373f49233eafa0a6c55435470c2fabf2ed84cd
MD5 416d042c43b6fde75c6fcb827c0f4015
BLAKE2b-256 109c365862069719c314050cc07f52d691951cd12f4221defb14fea476c796c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page