{"id":21446251,"url":"https://github.com/myussufz/html2pdf","last_synced_at":"2025-03-17T01:25:16.183Z","repository":{"id":93685570,"uuid":"122649243","full_name":"myussufz/html2pdf","owner":"myussufz","description":"Go for wkhtmltopdf - Convert HTML to PDF using Webkit (fasthttp template)","archived":false,"fork":false,"pushed_at":"2019-02-14T15:32:57.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T11:23:59.124Z","etag":null,"topics":["fasthttp","golang","html2pdf","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myussufz.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}},"created_at":"2018-02-23T17:03:05.000Z","updated_at":"2019-02-14T15:32:58.000Z","dependencies_parsed_at":"2023-03-10T06:45:45.155Z","dependency_job_id":null,"html_url":"https://github.com/myussufz/html2pdf","commit_stats":null,"previous_names":["magicwebes/html2pdf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myussufz%2Fhtml2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myussufz%2Fhtml2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myussufz%2Fhtml2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myussufz%2Fhtml2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myussufz","download_url":"https://codeload.github.com/myussufz/html2pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243956029,"owners_count":20374422,"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":["fasthttp","golang","html2pdf","pdf","wkhtmltopdf"],"created_at":"2024-11-23T02:42:33.912Z","updated_at":"2025-03-17T01:25:16.158Z","avatar_url":"https://github.com/myussufz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html2pdf\n\nhtml2pdf use wkhtmltopdf to generate PDF. It wrapper of the wkhtmltopdf using fasthttp template for html render.\n\nThis repo still under development. We accept any pull request. ^\\_^\n\n## Installation\n\n```bash\n  // dependency\n  $ go get github.com/magicwebes/html2pdf\n  $ go get github.com/valyala/fasttemplate\n\n  // Downloading wkhtmltopdf from this website and install to the computer or server\n  https://wkhtmltopdf.org/downloads.html\n```\n\n## Quick Start\n\n### Convert html file to pdf and download\n\n```go\n  filepath := \"public/views/index.html\"\n  data := map[string]interface{}{\n    \"message\": \"hello\",\n  }\n  outputPath := \"public/views/index.pdf\"\n\n  if err := html2pdf.ParseHTML(filepath, data).ToFile(outputPath); err != nil {\n      log.Println(\"error\", err)\n  }\n```\n\n## Advance Usage\n\n###\n\n```go\n  filepath := \"public/views/data.html\"\n  data := map[string]interface{}{\n    \"message\": \"hello\", // pass data to html file\n  }\n  outputPath := \"public/views/data.pdf\"\n\n  if err := html2pdf.ParseHTML(filepath, data).\n    SetConfig(\u0026html2pdf.Config{\n        Orientation: html2pdf.OrientationLandscape,\n        PageSize: html2pdf.PageSizeA4,\n    }).\n    ToFile(outputPath); err != nil {\n      log.Println(\"error\", err)\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyussufz%2Fhtml2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyussufz%2Fhtml2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyussufz%2Fhtml2pdf/lists"}