{"id":20310338,"url":"https://github.com/hs-web/hsweb-printer","last_synced_at":"2025-04-11T15:51:05.218Z","repository":{"id":37663668,"uuid":"65964253","full_name":"hs-web/hsweb-printer","owner":"hs-web","description":"模版打印组件,支持打印,支持输出svg,pdf,image. ","archived":false,"fork":false,"pushed_at":"2023-05-31T03:24:10.000Z","size":39691,"stargazers_count":92,"open_issues_count":1,"forks_count":74,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-03-25T11:52:28.343Z","etag":null,"topics":["java","printer","printer-image","printer-pdf","printer-svg"],"latest_commit_sha":null,"homepage":"","language":"Java","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/hs-web.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}},"created_at":"2016-08-18T04:08:28.000Z","updated_at":"2024-12-02T05:34:59.000Z","dependencies_parsed_at":"2023-01-31T10:46:10.166Z","dependency_job_id":"153cc43b-784b-4b38-89b6-0f74f859ef2e","html_url":"https://github.com/hs-web/hsweb-printer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hs-web%2Fhsweb-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hs-web%2Fhsweb-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hs-web%2Fhsweb-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hs-web%2Fhsweb-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hs-web","download_url":"https://codeload.github.com/hs-web/hsweb-printer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248434683,"owners_count":21102884,"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":["java","printer","printer-image","printer-pdf","printer-svg"],"created_at":"2024-11-14T17:31:20.543Z","updated_at":"2025-04-11T15:51:05.192Z","avatar_url":"https://github.com/hs-web.png","language":"Java","readme":"# 模版打印组件\n支持打印,支持输出为svg,pdf,image.\n```json\n[\n    {\n        \"layers\":[\n          {\"type\":\"图层类型\",\"x\":\"x坐标\",\"y\":\"y坐标\",\"width\":200,\"heigth\":100,\"color\":\"16进制颜色,如:#4d99bf\"}\n        ]\n    }\n]\n```\n\n```java\n List\u003cPager\u003e pagers = new JsonPageBuilder().build(json);\n List\u003cString\u003e svgs = PrinterUtils.printToSvg(pagers);\n \n```\n\n图层列表:\n\n| 图层类型 | type |                       属性列表                       |\n|-----:|:----:|:------------------------------------------------:|\n|   文字 | text | x,y,fontFamily,fontSize,color,width,height,align |\n|    线 | line |                x1,y1,x2,y2,color                 |\n|   矩形 | rect |              x,y,width,height,color              |\n|   图片 | img  |         x,y,width,height,imgType,imgData         |\n\n属性说明:\n\n|         属性 |              说明               |   支持图层   |\n|-----------:|:-----------------------------:|:--------:|\n|          x |              x坐标              |  除线外全部   |\n|          y |              y坐标              |  除线外全部   |\n|         x1 |           线的横向起点坐标            |    线     |\n|         x2 |     线的横向终点坐标,x2-x1则为线的长度      |    线     |\n|         y1 |           线的纵向起点坐标            |    线     |\n|         y2 |      线的纵向终点坐标,y1==y2则为直线      |    线     |\n|      width |              宽度               | 矩形,图片,文字 |\n|     height |              高度               | 矩形,图片,文字 |\n|       text |             文字内容              |    文字    |\n|      align | 文字居中方式,both,center,left,right |    文字    |\n| fontFamily |         字体,不支持指定多个字体          |    文字    |\n|   fontSize |             字体大小              |    文字    |\n|      color |      颜色,格式为16进制:#4d99bf       |  除图片外全部  |\n|    imgType |             图片类型              |    图片    |\n|    imgData |       图片数据(格式见`图片格式表`)        |    图片    |\n\n图片格式表:\n\n| imgType |           说明            | imgData                                                          |\n|--------:|:-----------------------:|:-----------------------------------------------------------------|\n|  static | 静态文件地址,支持本地,远程,base64图片 | `file:D:/imags/test.png` , `http://server/test.png` ,`base64字符串` |\n|  qrCode |           二维码           | 字符串,如: abc ,将会生成对应的二维码图片                                         |\n| barCode |           条形码           | 和二维码相同,注意:不支持中文                                                  |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhs-web%2Fhsweb-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhs-web%2Fhsweb-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhs-web%2Fhsweb-printer/lists"}