{"id":19349141,"url":"https://github.com/bartmika/htmltoimage-server","last_synced_at":"2026-06-11T22:31:25.811Z","repository":{"id":60958096,"uuid":"547020069","full_name":"bartmika/htmltoimage-server","owner":"bartmika","description":"Selfhosted HTML to image service powered by Golang RPC server for your web-applications.","archived":false,"fork":false,"pushed_at":"2022-10-07T05:56:05.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T10:18:56.761Z","etag":null,"topics":["golang","selfhost"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartmika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-07T02:39:26.000Z","updated_at":"2022-10-07T02:40:26.000Z","dependencies_parsed_at":"2022-10-07T11:37:13.178Z","dependency_job_id":null,"html_url":"https://github.com/bartmika/htmltoimage-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bartmika/htmltoimage-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fhtmltoimage-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fhtmltoimage-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fhtmltoimage-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fhtmltoimage-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartmika","download_url":"https://codeload.github.com/bartmika/htmltoimage-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fhtmltoimage-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34221150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","selfhost"],"created_at":"2024-11-10T04:24:51.345Z","updated_at":"2026-06-11T22:31:25.792Z","avatar_url":"https://github.com/bartmika.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML to Image Server\n\nSelf-hosted HTML to image service powered by Golang RPC server for your web-applications.\n\n## Installation\n\nCreate the `docker-compose.yml` file your directory.\n\n```yaml\nversion: '3.8'\nservices:\n  app:\n    container_name: htmltoimage_server_app\n    image: bartmika/htmltoimage-server:latest\n    stdin_open: true\n    environment:\n        HTMLTOIMAGE_SERVER_IP: 0.0.0.0\n        HTMLTOIMAGE_SERVER_PORT: 8002\n        HTMLTOIMAGE_SERVER_CHROME_HEADLESS_WS_URL: ws://browserless:9090\n    restart: unless-stopped\n    ports:\n      - \"8002:8002\"\n    depends_on:\n      - browserless\n    links:\n      - browserless\n\n  browserless:\n    image: browserless/chrome:latest\n    environment:\n      - DEBUG=browserless:*\n      - MAX_CONCURRENT_SESSIONS=10\n      - CONNECTION_TIMEOUT=60000\n      - MAX_QUEUE_LENGTH=20\n      - PREBOOT_CHROME=true\n      - DEMO_MODE=false\n      - HOST=0.0.0.0\n      - ENABLE_DEBUGGER=false\n      - PORT=9090\n      - WORKSPACE_DELETE_EXPIRED=true\n    container_name: \"htmltoimage_server_browserless\"\n    restart: unless-stopped\n```\n\nStart the service.\n\n```shell\n$ docker compose up -d\n```\n\n## Usage\n\nHere is a sample program of how to utilize the service.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/bartmika/htmltoimage-server/pkg/rpc\"\n)\n\n// NOTE:\n// Before you begin running this code, make sure the HTML to Image server is\n// running before you execute this program.\n\nfunc main() {\n\t// Generate the HTML to Image server based on your `docker-compose.yml`.\n\tserverIP := \"127.0.0.1\"\n\tserverPort := \"8002\"\n\tapplicationAddress := fmt.Sprintf(\"%s:%s\", serverIP, serverPort)\n\n\t// Connect to a running client.\n\tclient, err := rpc.NewClient(applicationAddress, 3, 15*time.Second)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n    // Execute the remote call.\n    imgBin, err := client.Screenshot(\"https://bartlomiejmika.com\")\n    if err != nil {\n        log.Fatal(\"Sample command failed generating image with error:\", err)\n    }\n\n    // Save our file.\n    if err := ioutil.WriteFile(\"data/screenshot.png\", imgBin, 0o644); err != nil {\n        log.Fatal(\"Sample command failed writing file with error:\", err)\n    }\n    log.Println(\"Saved file: screenshot.png\")\n}\n```\n\nFinally if you look in your `data` folder, you'll see the `screenshot.png` image downloaded!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartmika%2Fhtmltoimage-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartmika%2Fhtmltoimage-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartmika%2Fhtmltoimage-server/lists"}