Một mục mã nguồn mở trong kho dữ liệu GitHub của TopGit: fathyb/html2svg, 1.3k sao, TypeScript. Convert HTML and `<canvas>` to SVG, PDF, or images using Chromium
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/fathyb/html2svg là nguồn chính thức.
fathyb/html2svg có bao nhiêu sao?
fathyb/html2svg có 1.3k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/fathyb/html2svg. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
fathyb/html2svg có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho fathyb/html2svg. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
fathyb/html2svg có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho fathyb/html2svg. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
fathyb/html2svg là gì?
fathyb/html2svg (fathyb/html2svg) là dự án TypeScript trên GitHub. Theo mô tả gốc: Convert HTML and `<canvas>` to SVG, PDF, or images using Chromium
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về html2svg?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về html2svg.