{"id":18171321,"url":"https://github.com/joeychilson/webpage","last_synced_at":"2026-05-02T02:40:03.240Z","repository":{"id":260731595,"uuid":"881403278","full_name":"joeychilson/webpage","owner":"joeychilson","description":"A Go library and CLI tool for capturing webpages as PDFs or images.","archived":false,"fork":false,"pushed_at":"2024-10-31T14:01:51.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T12:18:29.816Z","etag":null,"topics":["chrome","go","pdf","screenshots"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeychilson.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-31T14:01:50.000Z","updated_at":"2024-10-31T14:02:35.000Z","dependencies_parsed_at":"2024-11-02T07:05:52.829Z","dependency_job_id":"985c83df-67bd-41ff-bbff-2df198f0e162","html_url":"https://github.com/joeychilson/webpage","commit_stats":null,"previous_names":["joeychilson/webpage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fwebpage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fwebpage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fwebpage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fwebpage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeychilson","download_url":"https://codeload.github.com/joeychilson/webpage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247620761,"owners_count":20968280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chrome","go","pdf","screenshots"],"created_at":"2024-11-02T15:08:41.070Z","updated_at":"2026-05-02T02:40:03.180Z","avatar_url":"https://github.com/joeychilson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpage\n\nA Go library and CLI tool for capturing webpages as PDFs or images.\n\n## Supported Features\n\n- PDFs\n- Images (PNG/JPEG)\n\n## Requirements\n\n- Chrome/Chromium browser installed on the system\n\n## Installation\n\n### Library\n\n```bash\ngo get github.com/joeychilson/webpage\n```\n\n### CLI Tool\n\n```bash\ngo install github.com/joeychilson/webpage/cmd/webpage@latest\n```\n\n## Library Usage\n\n### Basic PDF Generation\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"os\"\n    \"github.com/joeychilson/webpage\"\n)\n\nfunc main() {\n    page := webpage.New(\"https://example.com\")\n    \n    pdf, err := page.PDF(context.Background())\n    if err != nil {\n        panic(err)\n    }\n    \n    os.WriteFile(\"output.pdf\", pdf, 0644)\n}\n```\n\n### Customized PDF Generation\n\n```go\npage := webpage.New(\"https://example.com\",\n    webpage.WithTimeout(60*time.Second),\n    webpage.WithUserAgent(\"Custom User Agent\"),\n)\n\npdf, err := page.PDF(context.Background(),\n    webpage.WithLandscape(true),\n    webpage.WithBackground(true),\n    webpage.WithScale(1.2),\n    webpage.WithPaperWidth(11.0),\n    webpage.WithPaperHeight(17.0),\n    webpage.WithMarginTop(1.0),\n    webpage.WithPageRanges(\"1-5\"),\n)\n```\n\n### Screenshot Capture\n\n```go\npage := webpage.New(\"https://example.com\")\n\nscreenshot, err := page.Screenshot(context.Background(),\n    webpage.WithFormat(\"jpeg\"),\n    webpage.WithQuality(90),\n)\n```\n\n## CLI Usage\n\nThe `webpage` CLI tool provides a command-line interface to the webpage capture functionality.\n\n### Basic Commands\n\n```bash\n# Generate PDF\nwebpage pdf https://example.com -o output.pdf\n\n# Capture screenshot\nwebpage screenshot https://example.com -o output.png\n```\n\n### PDF Options\n\n```bash\nwebpage pdf https://example.com -o output.pdf \\\n    --landscape \\\n    --background \\\n    --scale 1.2 \\\n    --width 11 \\\n    --height 17 \\\n    --margin-top 1 \\\n    --margin-bottom 1 \\\n    --margin-left 1 \\\n    --margin-right 1 \\\n    --pages \"1-5\"\n```\n\n### Screenshot Options\n\n```bash\nwebpage screenshot https://example.com -o output.jpg \\\n    --format jpeg \\\n    --quality 90\n```\n\n### Common Options\n\n```bash\n# Set timeout\nwebpage pdf https://example.com -o output.pdf --timeout 60s\n\n# Set user agent\nwebpage pdf https://example.com -o output.pdf --user-agent \"Custom User Agent\"\n```\n\n## Configuration Options\n\n### Browser Options\n\n| Option | CLI Flag | Description | Default |\n|--------|----------|-------------|---------|\n| Timeout | `--timeout, -t` | Operation timeout | 30s |\n| User Agent | `--user-agent, -u` | Browser user agent | Chrome default |\n\n### PDF Options\n\n| Option | CLI Flag | Description | Default |\n|--------|----------|-------------|---------|\n| Landscape | `--landscape, -l` | Landscape orientation | false |\n| Background | `--background, -b` | Include background graphics | false |\n| Scale | `--scale, -s` | Scale factor | 1.0 |\n| Paper Width | `--width` | Paper width (inches) | 8.5 |\n| Paper Height | `--height` | Paper height (inches) | 11.0 |\n| Margin Top | `--margin-top` | Top margin (inches) | 0.4 |\n| Margin Bottom | `--margin-bottom` | Bottom margin (inches) | 0.4 |\n| Margin Left | `--margin-left` | Left margin (inches) | 0.4 |\n| Margin Right | `--margin-right` | Right margin (inches) | 0.4 |\n| Page Ranges | `--pages` | Page ranges to print | \"\" (all) |\n\n### Screenshot Options\n\n| Option | CLI Flag | Description | Default |\n|--------|----------|-------------|---------|\n| Format | `--format, -f` | Image format (png/jpeg) | png |\n| Quality | `--quality, -q` | JPEG quality (0-100) | 100 |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeychilson%2Fwebpage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeychilson%2Fwebpage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeychilson%2Fwebpage/lists"}