{"id":15010740,"url":"https://github.com/goquati/web2pdf","last_synced_at":"2026-03-16T22:03:47.525Z","repository":{"id":254311412,"uuid":"846148325","full_name":"goquati/web2pdf","owner":"goquati","description":"A REST API service that generates PDFs from web pages using Chromium, with support for both browser-accessible and programmatic API endpoints.","archived":false,"fork":false,"pushed_at":"2025-01-17T15:08:32.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-17T15:24:35.547Z","etag":null,"topics":["chromium","docker","pdf","rest-api","web2pdf","web2print"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/goquati.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-08-22T16:14:17.000Z","updated_at":"2025-01-17T15:07:50.000Z","dependencies_parsed_at":"2024-11-21T01:15:43.936Z","dependency_job_id":null,"html_url":"https://github.com/goquati/web2pdf","commit_stats":null,"previous_names":["goquati/web2pdf"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goquati%2Fweb2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goquati%2Fweb2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goquati%2Fweb2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goquati%2Fweb2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goquati","download_url":"https://codeload.github.com/goquati/web2pdf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243291337,"owners_count":20267883,"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":["chromium","docker","pdf","rest-api","web2pdf","web2print"],"created_at":"2024-09-24T19:35:35.418Z","updated_at":"2025-12-28T22:26:33.445Z","avatar_url":"https://github.com/goquati.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web2pdf\n\n`web2pdf` is a lightweight REST API service that allows you to generate PDF files from web pages using Chromium. The service is implemented in Kotlin and provides both GET and POST endpoints, enabling flexible usage for different scenarios.\n\n## Features\n\n- **Chromium-based PDF generation:** Leverages Chromium's print-to-PDF functionality to ensure high-quality PDF output.\n- **GET Endpoint:** Easily configure your print settings via a URL, which can be shared or called directly in the browser to generate a PDF.\n- **POST Endpoint:** Designed for programmatic access, allowing more complex API interactions.\n\n## Installation\n\nThe easiest way to get `web2pdf` up and running is by using the provided Docker image.\n\n### Docker\n\n1. Pull the Docker image:\n   ```bash\n   docker pull goquati/web2pdf:latest\n   ```\n\n2. Run the container:\n   ```bash\n   docker run -p 8080:8080 goquati/web2pdf:latest\n   ```\n\nThis will start the `web2pdf` service on port `8080` of your local machine.\n\n## Usage\n\n### GET Endpoint\n\nThe GET endpoint allows you to generate a PDF by simply calling a URL. This is useful for quick, one-off conversions or sharing with others.\n\n**Endpoint:** `/web2pdf`\n\n**Example:**\n\n```bash\nGET /web2pdf?url=http://example.com\u0026header[Authorization]=my-token\u0026cookie[my-cookie]=my-cookie-value\u0026options.landscape=false\u0026options.printBackground=true\n```\n\n**Query Parameters:**\n\n- `url`: (Required) The URL of the webpage you want to convert to PDF.\n- `header`: (Optional) HTTP headers to include in the request.\n- `cookie`: (Optional) Cookies to include in the request.\n- `options`: (Optional) PDF print options such as `landscape`, `printBackground`, `scale`, `paperWidth`, `paperHeight`, etc.\n\n**Response:**\n\n- **200 OK**: Returns the generated PDF.\n- **400 Bad Request**: Returns an error response if the request is invalid.\n\n### POST Endpoint\n\nThe POST endpoint is ideal for more API-like usage, where you need to pass more complex data structures.\n\n**Endpoint:** `/web2pdf`\n\n**Example:**\n\n```bash\nPOST /web2pdf\nContent-Type: application/json\n\n{\n  \"url\": \"http://example.com\",\n  \"headers\": {\n    \"Authorization\": \"my-token\"\n  },\n  \"cookies\": {\n    \"my-cookie\": \"my-cookie-value\"\n  },\n  \"options\": {\n    \"landscape\": false,\n    \"printBackground\": true\n  }\n}\n```\n\n**Request Body:**\n\n- `url`: (Required) The URL of the webpage you want to convert to PDF.\n- `headers`: (Optional) HTTP headers to include in the request.\n- `cookies`: (Optional) Cookies to include in the request.\n- `options`: (Optional) PDF print options, similar to the GET endpoint.\n\n**Response:**\n\n- **200 OK**: Returns the generated PDF.\n- **400 Bad Request**: Returns an error response if the request is invalid.\n\n## OpenAPI Specification\n\nThe full OpenAPI specification for the `web2pdf` service is available in the repository at [oas.yaml](./oas.yaml). This specification provides detailed information about the endpoints, request/response formats, and available parameters.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n---\n\nWith `web2pdf`, you can easily convert web pages to PDFs with just a URL or a simple API call. Whether you're looking to automate the process or need quick access to a PDF version of a page, `web2pdf` has you covered.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoquati%2Fweb2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoquati%2Fweb2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoquati%2Fweb2pdf/lists"}