{"id":22125423,"url":"https://github.com/notadd/nt-pdf2png","last_synced_at":"2026-02-04T11:43:59.125Z","repository":{"id":94558207,"uuid":"153578057","full_name":"notadd/nt-pdf2png","owner":"notadd","description":"pdf 转 png 方案 ，基于 https://github.com/mooz/node-pdf-image","archived":false,"fork":false,"pushed_at":"2024-12-13T05:51:10.000Z","size":11487,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T10:21:50.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/notadd.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-18T07:01:08.000Z","updated_at":"2020-03-13T08:03:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"b99a02a7-062f-45bb-bb3e-efdb2c950086","html_url":"https://github.com/notadd/nt-pdf2png","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/notadd/nt-pdf2png","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-pdf2png","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-pdf2png/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-pdf2png/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-pdf2png/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notadd","download_url":"https://codeload.github.com/notadd/nt-pdf2png/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-pdf2png/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29083180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"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-12-01T16:20:48.064Z","updated_at":"2026-02-04T11:43:59.107Z","avatar_url":"https://github.com/notadd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nt-pdf2png\n\npdf 转 png 方案，尽在用户访问时转换，大大节省了服务器资源，秒开。\n\n### ubuntu \n\n```\nsudo apt-get install imagemagick ghostscript poppler-utils\n```\n\n\n### OSX (Yosemite)\n\n```\nbrew install imagemagick ghostscript poppler\n```\n\n## 使用 （use）\n\n\n1.  修改配置文件\n\n一般在： `/etc/ImageMagick-6/policy.xml`\n\n将文件末尾三行改为\n\n```\n  \u003cpolicy domain=\"coder\" rights=\"read|write\" pattern=\"PDF\" /\u003e\n  \u003cpolicy domain=\"coder\" rights=\"none\" pattern=\"XPS\" /\u003e\n  \u003cpolicy domain=\"coder\" rights=\"read|write\" pattern=\"LABEL\" /\u003e\n\n```\n\n2. 克隆项目，在项目下 npm install \n\n```\nnpm install\n```\n\n3. 运行\n\n```\nnpm run start\n```\n\n4. 访问 `http://localhost:3000/test/test.pdf/0.png`\n\ntest.pdf 为文件名， 0.png 为页码（第一页是0）。\n\n\n## todo\n\n- [ ] 使用 typescript 重写\n- [ ] 使用 sharp 替代现有库","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotadd%2Fnt-pdf2png","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotadd%2Fnt-pdf2png","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotadd%2Fnt-pdf2png/lists"}