{"id":18023607,"url":"https://github.com/jeffotoni/gowkhtmltopdf","last_synced_at":"2025-10-13T22:42:08.991Z","repository":{"id":134047376,"uuid":"154849406","full_name":"jeffotoni/gowkhtmltopdf","owner":"jeffotoni","description":"uma image docker com o programa wkhtmltopdf e um server em Go para converter html em pdf","archived":false,"fork":false,"pushed_at":"2021-04-22T14:59:08.000Z","size":31989,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T16:03:18.581Z","etag":null,"topics":["docker","go","golang","html","pdf","wkhtmltopdf"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeffotoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-10-26T14:44:01.000Z","updated_at":"2023-03-25T12:01:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"faca64f0-40df-40a9-b2a8-ba983aae2096","html_url":"https://github.com/jeffotoni/gowkhtmltopdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeffotoni/gowkhtmltopdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgowkhtmltopdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgowkhtmltopdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgowkhtmltopdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgowkhtmltopdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffotoni","download_url":"https://codeload.github.com/jeffotoni/gowkhtmltopdf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgowkhtmltopdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017144,"owners_count":26085984,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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":["docker","go","golang","html","pdf","wkhtmltopdf"],"created_at":"2024-10-30T07:10:00.204Z","updated_at":"2025-10-13T22:42:08.969Z","avatar_url":"https://github.com/jeffotoni.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gowkhtmltopdf\nUma image docker com o programa wkhtmltopdf e um server em Go para converter html em pdf\n\nA API irá receber um HTML e retornar um PDF, o html terá que ser passado como json para API.\n\n# Rodando API com Docker\n\n```sh\n\n$ docker run --restart=always -d -p 5010:5010 --name gowkhtmltopdf \\\n\tjeffotoni/gowkhtmltopdf:latest\n\n$ docker logs -f \u003cid-container\u003e\n\n$ curl -X POST localhost:5010/v1/api/topdf -H \"Content-Type: application/json\" \\\n--data @table.html.json --output /tmp/meuteste.pdf\n\n```\n\n# Build em sua máquina local\n\n```bash\n\n$ docker build --no-cache -f DockerfileAlpine --build-arg PORT=5010 \\\n\t-t xxxxxxxxxxxxx/gowkhtmltopdf:latest .\n\n$ docker run --restart=always -d -p 5010:5010 --name gowkhtmltopdf \\\n\tjeffotoni/gowkhtmltopdf:latest\n\n// -- or\n\n$ docker run -p 5010:5010 --name gowkhtmltopdf -e X_KEY=xxxxxx \\\n\tjeffotoni/gohtmltopdf\n\n$ docker logs -f \u003cid-container\u003e\n\n$ curl -X POST localhost:5010/v1/api/topdf -H \"Content-Type: application/json\" \\\n\t -H \"Authorization:Basic xxxxxx\" \\\n\t--data @table.html.json --output /tmp/meuteste.pdf\n\n```\n\n# Gerando Json do seu HTML antes de enviar para API\n\nA API recebe um JSON, o nome do arquivo e o html que deseja converter e retorna o PDF.\nPara gerar seu HTML em JSON só rodar o programinha abaixo.\n\nCampos permitidos\n```json\n{\n\t\"Nome\":\"meu_pdf\",\n\t\"Html\":\"\u003cbase 64 do HTML aqui\u003e\",\n\t\"grayscale\":false,\n\t\"nocollate\":false,\n\t\"image_dpi\":600,\n\t\"image_quality\":94,\n\t\"page_size\":\"A4\",\n\t\"orientation\":\"Portrait\",\n\t\"dpi\":600,\n\t\"margin_bottom\":2,\n\t\"margin_top\":2,\n\t\"margin_left\":2,\n\t\"margin_right\":2\n}\n```\n\nEste programa irá converter seu HTML em JSON e os campos necessários para geração do PDF\n```sh\n\n$ cd gerahtmljson\n$ go run main.go --file table.html\n\n```\n\n# Rodando o server sem usar docker\n\n```sh\n\n$ go run gowkhtmltopdf.go\n\n$ curl -X POST localhost:5010/v1/api/topdf -H \"Content-Type: application/json\" \\\n\t--data @table.html.json --output /tmp/meuteste.pdf\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffotoni%2Fgowkhtmltopdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffotoni%2Fgowkhtmltopdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffotoni%2Fgowkhtmltopdf/lists"}