fathyb/html2svg is an open-source project on GitHub with 1.3k stars, written primarily in TypeScript. Convert HTML and `<canvas>` to SVG, PDF, or images using Chromium
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Convert HTML and <canvas> to vector (SVG, PDF) or bitmap (PNG, JPEG, WebP) images using Chromium. Read the blog post.
Usage
# Export to SVG
$ docker run fathyb/html2svg https://google.com > google.svg
$ docker run fathyb/html2svg https://google.com --format svg > google.svg
# Export to PDF
$ docker run fathyb/html2svg https://google.com --format pdf > google.pdf
# Export to PNG
$ docker run fathyb/html2svg https://google.com --format png > google.png
# Display help
$ docker run fathyb/html2svg --help
Usage: html2svg [options] [command] <url>
Arguments:
url URL to the web page to render
Options:
-f, --full capture the entire page
-W, --wait <seconds> set the amount of seconds to wait between the page loaded event and taking the screenshot (default: 1)
-w, --width <width> set the viewport width in pixels (default: 1920)
-h, --height <height> set the viewport height in pixels (default: 1080)
-f, --format <format> set the output format, should one of these values: svg, pdf, png, jpg, webp (default: "svg")
--help display help for command
Commands:
serve [options]
Server
An HTTP server is also provided, all CLI options are supported:
# Start a server on port 8080
$ docker run -p 8080:8080 fathyb/html2svg serve
# Export to SVG
$ curl -d http://google.fr http://localhost:8080 > google.svg
$ curl -d '{"url": "http://google.fr", "format": "svg"}' http://localhost:8080 > google.svg
# Export to PDF
$ curl -d '{"url": "http://google.fr", "format": "pdf"}' http://localhost:8080 > google.pdf
# Export to PNG
$ curl -d '{"url": "http://google.fr", "format": "png"}' http://localhost:8080 > google.png
# Display help
$ docker run fathyb/html2svg serve --help
Usage: html2svg serve [options]
Options:
-H, --host <hostname> set the hostname to listen on (default: "localhost")
-p, --port <hostname> set the port to listen on (default: 8080)
-u, --unix <path> set the unix socket to listen on
-h, --help display help for command
Development
Building Chromium is only officially supported on AMD64. If you'd like to target ARM64, cross-compile from AMD64 instead.
Local
You'll need to install all tools required to build Chromium: https://www.chromium.org/developers/how-tos/get-the-code/
If you're running Linux, you can use the Docker build instructions to generate binaries.
Fetch dependencies:
$ yarn
Clone Electron.js and Chromium using gclient:
$ yarn gclient
Configure the build system using gn using one of these commands:
# for local developement
$ yarn gn testing
# or for releasing
$ yarn gn release
# add --ide=xcode if you'd like to generate an Xcode project on macOS
$ yarn gn release --ide=xcode
Build using ninja using one of these commands:
# make a testing build
$ yarn ninja testing
# make a release build
$ yarn ninja release
Docker
We use docker run instead of Dockerfile for building Chromium to support incremental building.
No homepage URL was recorded for fathyb/html2svg in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How many stars does fathyb/html2svg have?
fathyb/html2svg has 1.3k GitHub stars — refresh the page for the live number, or check github.com/fathyb/html2svg. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is fathyb/html2svg open source?
TopGit's metadata for fathyb/html2svg does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What is fathyb/html2svg?
fathyb/html2svg (fathyb/html2svg) is a TypeScript project on GitHub. From the project's own README: Convert HTML and `<canvas>` to SVG, PDF, or images using Chromium
Where do I read more about fathyb/html2svg?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/fathyb/html2svg is the definitive source.
Read full README in the tab above.
Want a second opinion on html2svg?
Ask an AI that can read this page — one click and you get its take on html2svg.