{"id":36924246,"url":"https://github.com/lampnick/doctron","last_synced_at":"2026-01-16T21:25:59.545Z","repository":{"id":37700046,"uuid":"298939333","full_name":"lampnick/doctron","owner":"lampnick","description":"html转pdf , html转图片 , Docker-powered html convert to pdf(html2pdf), html to image(html2image like jpeg,png),which using chrome(golang) kernel.","archived":false,"fork":false,"pushed_at":"2024-06-13T12:31:50.000Z","size":10558,"stargazers_count":522,"open_issues_count":13,"forks_count":119,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-06-18T20:24:02.881Z","etag":null,"topics":["converter","go-html-pdf","headless-chrome","html","html2image","html2pdf","htmltoimage","htmltopdf","image","jpeg","pdf","pdf-converter","pdf-generation","pdf-generator","pdf-watermark","pdfkit","png","url-to-image","url-to-pdf","watermark"],"latest_commit_sha":null,"homepage":"http://doctron.mitnick.fun","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lampnick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2020-09-27T02:44:42.000Z","updated_at":"2024-06-14T07:43:52.000Z","dependencies_parsed_at":"2023-11-29T01:32:31.991Z","dependency_job_id":"0e112326-bda8-4d0b-9637-9c7a9daa3d1a","html_url":"https://github.com/lampnick/doctron","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lampnick/doctron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lampnick%2Fdoctron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lampnick%2Fdoctron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lampnick%2Fdoctron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lampnick%2Fdoctron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lampnick","download_url":"https://codeload.github.com/lampnick/doctron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lampnick%2Fdoctron/sbom","scorecard":{"id":578130,"data":{"date":"2025-08-11","repo":{"name":"github.com/lampnick/doctron","commit":"c3e8adff174d291cff06b006ce9b19dab3406a21"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 2/19 approved changesets -- score normalized to 1","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":"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":"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"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":"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:17: pin your Docker image by updating lampnick/runtime:chromium-alpine to lampnick/runtime:chromium-alpine@sha256:4d00e8d8ffe6086e3eedb6b177aa98dbc7be691958dab61db82df378edc86788","Warn: containerImage not pinned by hash: Dockerfile.doctron.centos:1","Warn: containerImage not pinned by hash: Dockerfile.golang.centos:1: pin your Docker image by updating centos:7 to centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4","Warn: containerImage not pinned by hash: Dockerfile.runtime.alpine:1: pin your Docker image by updating alpine:3.12.0 to alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321","Info:   0 out of   5 containerImage dependencies pinned"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 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":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2958 / GHSA-3669-72x9-r9p3","Warn: Project is vulnerable to: GO-2022-0272 / GHSA-jcxc-rh6w-wf49","Warn: Project is vulnerable to: GO-2022-0355 / GHSA-fx95-883v-4q4h","Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77"],"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-20T18:24:12.823Z","repository_id":37700046,"created_at":"2025-08-20T18:24:12.823Z","updated_at":"2025-08-20T18:24:12.823Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["converter","go-html-pdf","headless-chrome","html","html2image","html2pdf","htmltoimage","htmltopdf","image","jpeg","pdf","pdf-converter","pdf-generation","pdf-generator","pdf-watermark","pdfkit","png","url-to-image","url-to-pdf","watermark"],"created_at":"2026-01-12T19:00:25.490Z","updated_at":"2026-01-16T21:25:59.539Z","avatar_url":"https://github.com/lampnick.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"### [English](README.md) | [中文](README_ZH.md)\n\n### Table of Contents\n\n- [Doctron description](#doctron-description)\n- [Online experience](#online-experience)\n- [Convert preview](#convert-preview)\n- [Encourage](#encourage)\n- [Features](#features)\n- [Installing](#installing)\n- [Quick Start](#quick-start)\n  - [Html convert to pdf](#html-convert-to-pdf)\n        - [basic](#basic)\n        - [custom size](#custom-size)\n        - [support params](#support-params)\n  - [Html convert to image](#html-convert-to-image)\n        - [basic](#basic-1)\n        - [custom size](#custom-size-1)\n        - [support params](#support-params-1)\n  - [Pdf add watermark](#pdf-add-watermark)\n        - [add image watermark](#add-image-watermark)\n        - [support params](#support-params-2)\n  - [Pdf convert to image](#pdf-convert-to-image)\n        - [coming soon](#coming-soon)\n- [Doctron Client](#doctron-client)\n  - [Doctron go client](#doctron-go-client)\n        - [doctron-client-go](#doctron-client-go)\n  - [Doctron php client](#doctron-php-client)\n        - [doctron-client-php](#doctron-client-php)\n- [License](#license)\n- [Thanks JetBrains provide free GoLand IDE](#thanks-jetbrains-provide-free-goland-ide)\n## Doctron description\nDoctron is a Docker-powered,serverless,sample,fast,high quality document convert tool.Supply html convert to pdf(html2pdf), html convert to image(html2image like jpeg,png),which using chrome(Chromium) kernel, add watermarks to pdf, convert pdf to images etc.\n\n## Online experience\nopen the following website to have a try. Conversion may be slower due to low server configuration.\n[Doctron Live Demo](http://doctron.mitnick.fun)\n\n## Convert preview\n- source website: https://support.apple.com/zh-cn/iphone-12-and-iphone-12-pro-service-program-for-no-sound-issues\n- preview:\n- ![avatar](test_data/preview.png)\n\n## Encourage\nIf you feel doctron is not bad, give me a star and fork.Star and fork is my greatest encouragement！\n\n## Features\n- Html convert to pdf/image using chrome kernel to guarantee what you see is what you get.\n- Easy deployment.(Using docker,kubernetes.)\n- Rich transformation parameters.\n- Customize page size from html convert to pdf or image.\n- Serverless supported.\n\n## Installing\n- Using docker\n```\n#using default config\ndocker run -p 8080:8080 --rm --name doctron-alpine lampnick/doctron  \n#using custom config\ndocker run -p 8080:8080 --rm --name doctron-alpine \\\n-v /path/to/doctron/conf/doctron.yaml:/doctron.yaml \\\nlampnick/doctron  \n```\n- Using k8s\n```\nkubectl apply -f https://raw.githubusercontent.com/lampnick/doctron/master/manifests/k8s-doctron.yaml\n```\n- From source code\n```\nFirst step：\ndownload google-chrome，add  google-chrome path to system PATH .\nSecond step：\ngit clone https://github.com/lampnick/doctron.git\ncd doctron\ngo run main.go --config=./conf/default.yaml\n```\n\n- install doctron using `go get` \n```\nFirst step：\ndownload google-chrome，add  google-chrome path to system PATH .\nSecond step：\ngo get -v github.com/lampnick/doctron\nWhen finished then directly run\ndoctron --config=./conf/default.yaml\n```\n\n## Quick Start\n### Html convert to pdf\n###### basic\n```\nhttp://127.0.0.1:8080/convert/html2pdf?u=doctron\u0026p=lampnick\u0026url=\u003curl\u003e  \n```\n###### custom size\n```\nhttp://127.0.0.1:8080/convert/html2pdf?u=doctron\u0026p=lampnick\u0026url=\u003curl\u003e\u0026marginTop=0\u0026marginLeft=0\u0026marginRight=0\u0026marginbottom=0\u0026paperwidth=4.1  \n```\n###### support params\n- u/username // doctron username\n- p/password // doctron password\n- uploadKey // upload to oss key\n- url // need convert html url\n- landscape // Paper orientation. core.Defaults to false.\n- displayHeaderFooter // Display header and footer. core.Defaults to false.\n- printBackground // Print background graphics. core.Defaults to false.\n- scale // Scale of the webpage rendering. core.Defaults to 1.\n- paperWidth // Paper width in inches. core.Defaults to 8.5 inches.\n- paperHeight // Paper height in inches. core.Defaults to 11 inches.\n- marginTop // Top margin in inches. core.Defaults to 1cm (~0.4 inches).\n- marginBottom // Bottom margin in inches. core.Defaults to 1cm (~0.4 inches).\n- marginLeft // Left margin in inches. core.Defaults to 1cm (~0.4 inches).\n- marginRight // Right margin in inches. core.Defaults to 1cm (~0.4 inches).\n- pageRanges // Paper ranges to print, e.g., '1-5, 8, 11-13'. core.Defaults to the empty string, which means print all pages.\n- ignoreInvalidPageRanges // Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. core.Defaults to false.\n- headerTemplate  // HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document  For example, \u003cspan class=title\u003e\u003c/span\u003e would generate span containing the title.\n- footerTemplate  // HTML template for the print footer. Should use the same format as the headerTemplate.\n- preferCSSPageSize // Whether or not to prefer page size as defined by css. core.Defaults to false, in which case the content will be scaled to fit the paper size. (Generally, it can solve the problem that the single page converted to PDF will be inconsistent with the specified size)\n- WaitingTime // Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond \n\n### Html convert to image\n###### basic\n```\nhttp://127.0.0.1:8080/convert/html2image?u=doctron\u0026p=lampnick\u0026url=\u003curl\u003e  \n```\n###### custom size\n```\nhttp://127.0.0.1:8080/convert/html2image?u=doctron\u0026p=lampnick\u0026url=\u003curl\u003e\u0026customClip=true\u0026clipX=0\u0026clipY=0\u0026clipWidth=400\u0026clipHeight=1500\u0026clipScale=2\u0026format=jpeg\u0026Quality=80  \n```\n###### support params\n- u/username // doctron username\n- p/password // doctron password\n- uploadKey // upload to oss key\n- url // need convert html url\n- format // Image compression format (defaults to png).\n- quality // Compression quality from range [0..100] (jpeg only).\n- customClip //if set this value, the below clip will work,otherwise not work!\n- clipX // Capture the screenshot of a given region only.X offset in device independent pixels (dip).\n- clipY // Capture the screenshot of a given region only.Y offset in device independent pixels (dip).\n- clipWidth // Capture the screenshot of a given region only.Rectangle width in device independent pixels (dip).\n- clipHeight // Capture the screenshot of a given region only.Rectangle height in device independent pixels (dip).\nWaitingTime // Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond\n\n### Pdf add watermark\n###### add image watermark\n```\nhttp://127.0.0.1:8080/convert/pdfAddWatermark?u=doctron\u0026p=lampnick\u0026url=\u003cpdf url\u003e\u0026imageUrl=\u003cimage url\u003e\n```\n###### support params\n- u/username // doctron username\n- p/password // doctron password\n- uploadKey // upload to oss key\n- url // need convert html url\n- imageUrl // watermark image url,support png/jpeg\n\n### Pdf convert to image\n###### coming soon\n\n## Doctron Client\n### Doctron go client\n###### [doctron-client-go](https://github.com/lampnick/doctron-client-go)\n\n### Doctron php client\n###### [doctron-client-php](https://github.com/lampnick/doctron-client-php)\n\n## License\n\nDoctron is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/lampnick/doctron/blob/master/LICENSE)\n\n## [Thanks JetBrains provide free GoLand IDE](https://jb.gg/OpenSource)\n[![avatar](jetbrains.svg)](https://jb.gg/OpenSource)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flampnick%2Fdoctron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flampnick%2Fdoctron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flampnick%2Fdoctron/lists"}