{"id":13588990,"url":"https://github.com/mikeshimura/goreport","last_synced_at":"2026-01-12T08:00:00.692Z","repository":{"id":43923522,"uuid":"49600301","full_name":"mikeshimura/goreport","owner":"mikeshimura","description":"Golang Pdf Report Generator","archived":false,"fork":false,"pushed_at":"2025-02-25T14:13:13.000Z","size":6561,"stargazers_count":311,"open_issues_count":2,"forks_count":51,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-08-14T01:32:01.995Z","etag":null,"topics":[],"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/mikeshimura.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":"2016-01-13T20:37:22.000Z","updated_at":"2025-06-24T03:28:03.000Z","dependencies_parsed_at":"2025-02-22T04:21:23.143Z","dependency_job_id":"72b3c90b-964b-4f54-a37d-7fe2c9f56703","html_url":"https://github.com/mikeshimura/goreport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikeshimura/goreport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshimura%2Fgoreport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshimura%2Fgoreport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshimura%2Fgoreport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshimura%2Fgoreport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeshimura","download_url":"https://codeload.github.com/mikeshimura/goreport/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshimura%2Fgoreport/sbom","scorecard":{"id":645967,"data":{"date":"2025-08-11","repo":{"name":"github.com/mikeshimura/goreport","commit":"151f4b7c9bab795de09f7630009c039b5d4405f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T12:09:04.891Z","repository_id":43923522,"created_at":"2025-08-21T12:09:04.891Z","updated_at":"2025-08-21T12:09:04.891Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-08-01T16:00:17.785Z","updated_at":"2026-01-12T08:00:00.669Z","avatar_url":"https://github.com/mikeshimura.png","language":"Go","funding_links":[],"categories":["GO","Libraries"],"sub_categories":["Go"],"readme":"# goreport\nGolang Pdf Report Generator  \n[日本語の説明はこちら](https://github.com/mikeshimura/goreport/wiki/%E6%97%A5%E6%9C%AC%E8%AA%9E%E8%AA%AC%E6%98%8E)\n\nThis program use github.com/signintech/gopdf for pdf generation.\n\nSimple report sample\n![Simple1](https://github.com/mikeshimura/goreport/blob/master/example/simple11.jpg \"Simple1\")  \n![Simple1](https://github.com/mikeshimura/goreport/blob/master/example/simple12.jpg \"Simple1\")  \n\n[pdf](https://github.com/mikeshimura/goreport/wiki/pdf/simple1.pdf)  \n\n\nMedium report sample\n![Medium1](https://github.com/mikeshimura/goreport/blob/master/example/medium11.jpg \"Medium1\")\n![Medium1](https://github.com/mikeshimura/goreport/blob/master/example/medium12.jpg \"Medium1\")\n\n[pdf](https://github.com/mikeshimura/goreport/wiki/pdf/medium1.pdf)  \n\n\n\nComplex report sample\n![Complex1](https://github.com/mikeshimura/goreport/blob/master/example/complex11.jpg \"Complex1\")\n![Complex1](https://github.com/mikeshimura/goreport/blob/master/example/complex12.jpg \"Complex1\")\n\n[pdf](https://github.com/mikeshimura/goreport/wiki/pdf/complex1.pdf)  \n\n\n![Complex2](https://github.com/mikeshimura/goreport/blob/master/example/complex21.jpg \"Complex2\")\n![Complex2](https://github.com/mikeshimura/goreport/blob/master/example/complex22.jpg \"Complex2\")\n\n[pdf](https://github.com/mikeshimura/goreport/wiki/pdf/complex2.pdf)  \n\n## Installation\n```\ngo get -u github.com/mikeshimura/goreport\n```\n## concept\n- Following Bands are available.  \nPageHeader  \nGroupHeader2  \nGroupHeader1  \nDetail  \nGroupSummary1  \nGroupSummry2  \nSummary  \nPageFooter\n\n- Groups can be any number\n\n- User defined Band structure required to implement Band interface.  \nOnly two functions are required.\n\n\n```\nGetHeight(report GoReport) float64\nExecute(report GoReport)\n```\n\n- Two step executiion.  \nFirst step: Generate Text data.  \nSecond step: Generate Pdf from Text data.\n\n- Above two step execution enable very flexible usability.  \nYou may generate Text data by program, then any kind of pdf can be generated.\n\n- I use above flexibity to insert total pages data after generation automatically.\n\n- Band height can be changed program, therefore conditional display can be achieved.\n\n- Data source is stored as []interface{}, then any kind of data type can be used. For example, string array, entity object, map etc.\n\n- Any Ttf Font can be used\n\n## Setup Commands\n- Font Setting Sample\n```\nfont1 := gr.FontMap{\n\t\tFontName: \"IPAex\",\n\t\tFileName: \"ttf//ipaexg.ttf\",\n\t}\nfonts := []*gr.FontMap{\u0026font1}\nr.SetFonts(fonts)\n```\n- Page Setting  \n SetPage(size string, unit string, orientation string)  \n //size A4 or LTR, unit mm, pt or in  \n\n SetPageByDimension(unit string, width float64, height float64)  \n- Normal Print limit setting. PageFooter(if defined) will be written after reach this limt.  \n SetFooterY(footerY float64)  \n\n SetFooterYbyFooterHeight(footerHeight float64)  \n //Sheet height - footerHeight will be set  \n\n## Draw Commands\n\n- New Page  \nNewPage(resetPageNo bool)\n\n\n- Font setting  \nFont(fontName string, size int, style string)  \n//style \"\" or \"U\" (underline)  \n\n TextColor(red int, green int, blue int) //Set Font color  \n GrayFill(grayScale float64) //Set grayScale for black font  \n\n- Text Draw  \n Cell(x float64, y float64, content string)  \n CellRight(x float64, y float64, w float64, content string)  //Right Justify  \n\n- Line Draw  \n LineType(ltype string, width float64)\n //lineType \"dashed\" ,\"dotted\",\"straight\" \"\"=\"straight\"  \n GrayStroke(grayScale float64)  //Set grayScale  \n LineH(x1 float64, y float64, x2 float64) // Horizontal Line  \n LineV(x float64, y1 float64, y2 float64) // Vertical line  \n Line(x1 float64, y1 float64, x2 float64, y2 float64)  \n\n- Shape Draw  \n Rect(x1 float64, y1 float64, x2 float64, y2 float64)  \n Oval(x1 float64, y1 float64, x2 float64, y2 float64)  \n\n- Image  Draw  \n  Image(path string, x1 float64, y1 float64, x2 float64, y2 float64)  \n\n## Genarate Commands\n-  Execute(filename string)  \nGenarate PDF File.\n\n- GetBytesPdf() (ret []byte)  \nCreate byte stream\n\n## License  \n\ngoreport is released under the MIT License. It is copyrighted by Masanobu Shimura. (Gmail mikeshimura)\n\n## Limitation  \n\n- Font style not allow B(bold) and I(italic).\n- Line, Rect and Oval are Black and Gray only.\n- Image file format is jpeg only.\n\n## Sample program\n\n[sample source](https://github.com/mikeshimura/goreport/tree/master/example)\n```go\npackage example\n\nimport (\n\tgr \"github.com/mikeshimura/goreport\"\n\t\"strconv\"\n)\n\nfunc Simple1Report() {\n\tr := gr.CreateGoReport()\n\t//var accumrate amount\n\tr.SumWork[\"amountcum=\"]=0.0\n\tfont1 := gr.FontMap{\n\t\tFontName: \"IPAex\",\n\t\tFileName: \"ttf//ipaexg.ttf\",\n\t}\n\tfonts := []*gr.FontMap{\u0026font1}\n\tr.SetFonts(fonts)\n\td := new(S1Detail)\n\tr.RegisterBand(gr.Band(*d), gr.Detail)\n\th := new(S1Header)\n\tr.RegisterBand(gr.Band(*h), gr.PageHeader)\n\ts := new(S1Summary)\n\tr.RegisterBand(gr.Band(*s), gr.Summary)\n\tr.Records = gr.ReadTextFile(\"sales1.txt\",7)\n\tr.SetPage(\"A4\", \"mm\",\"L\")\n\tr.SetFooterY(190)\n\tr.Execute(\"simple1.pdf\")\n}\n\ntype S1Detail struct {\n}\n\nfunc (h S1Detail) GetHeight(report gr.GoReport) float64 {\n\treturn 10\n}\nfunc (h S1Detail) Execute(report gr.GoReport) {\n\tcols := report.Records[report.DataPos].([]string)\n\treport.Font(\"IPAex\", 12, \"\")\n\ty:=2.0\n\treport.Cell(15, y, cols[0])\n\treport.Cell(30, y, cols[1])\n\treport.Cell(60, y, cols[2])\n\treport.Cell(90, y, cols[3])\n\treport.Cell(120, y, cols[4])\n\treport.CellRight(135, y,25, cols[5])\n\treport.CellRight(160, y,20, cols[6])\n\tamt:=ParseFloatNoError(cols[5])*ParseFloatNoError(cols[6])\n\treport.SumWork[\"amountcum=\"]+=amt\n\treport.CellRight(180, y,30, strconv.FormatFloat(amt,'f',2,64))\n}\n\ntype S1Header struct {\n}\n\nfunc (h S1Header) GetHeight(report gr.GoReport) float64 {\n\treturn 30\n}\nfunc (h S1Header) Execute(report gr.GoReport) {\n\treport.Font(\"IPAex\", 14, \"\")\n\treport.Cell(50, 15, \"Sales Report\")\n\treport.Font(\"\", 12, \"\")\n\treport.Cell(240, 20, \"page\")\n\treport.Cell(260, 20, strconv.Itoa(report.Page))\n\ty:=23.0\n\treport.Cell(15, y, \"D No\")\n\treport.Cell(30, y, \"Dept\")\n\treport.Cell(60, y, \"Order\")\n\treport.Cell(90, y, \"Stock\")\n\treport.Cell(120, y,\"Name\")\n\treport.CellRight(135, y,25, \"Unit Price\")\n\treport.CellRight(160, y,20, \"Qty\")\n\treport.CellRight(190, y,20, \"Amount\")\n}\n\ntype S1Summary struct {\n}\n\nfunc (h S1Summary) GetHeight(report gr.GoReport) float64 {\n\treturn 10\n}\nfunc (h S1Summary) Execute(report gr.GoReport) {\n\treport.Cell(160, 2,\"Total\")\n\treport.CellRight(180, 2,30, strconv.FormatFloat(\n\t\t\treport.SumWork[\"amountcum=\"],'f',2,64))\n}\n\nfunc ParseFloatNoError(s string)float64{\n\tf,_:=strconv.ParseFloat(s,64)\n\treturn f\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeshimura%2Fgoreport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeshimura%2Fgoreport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeshimura%2Fgoreport/lists"}