{"id":20791291,"url":"https://github.com/theprofs/pdf-to-image","last_synced_at":"2025-10-23T20:32:48.572Z","repository":{"id":58237239,"uuid":"93629679","full_name":"TheProfs/pdf-to-image","owner":"TheProfs","description":"Progressively render PDF's to images in the browser ","archived":false,"fork":false,"pushed_at":"2019-03-02T10:21:15.000Z","size":736,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-17T16:11:23.957Z","etag":null,"topics":["image","pdf","pdfjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/TheProfs.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}},"created_at":"2017-06-07T11:50:26.000Z","updated_at":"2019-03-02T10:18:45.000Z","dependencies_parsed_at":"2022-08-31T03:01:47.257Z","dependency_job_id":null,"html_url":"https://github.com/TheProfs/pdf-to-image","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fpdf-to-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fpdf-to-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fpdf-to-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fpdf-to-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheProfs","download_url":"https://codeload.github.com/TheProfs/pdf-to-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243136238,"owners_count":20241988,"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":["image","pdf","pdfjs"],"created_at":"2024-11-17T15:43:03.920Z","updated_at":"2025-10-23T20:32:48.492Z","avatar_url":"https://github.com/TheProfs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/TheProfs/pdf-to-image.svg?branch=master)](https://travis-ci.org/TheProfs/pdf-to-image)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\n# pdf-to-image\n\u003e Progressively render PDF's as images on the client -\ncleanly wraps [Mozilla/PDF.js][1]\n\n## Usage\n\nDepends on [Mozilla/PDF.js][1], you can find distribution versions [here][2]\nor just grab it from a [CDN][3]\n\n```html\n\u003c!-- Include PDF.js and pdf-to-image.js in this order --\u003e\n\u003cscript src=\"dist/pdf-to-image-dist.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"pdfjs/pdf.min.js\"\u003e\u003c/script\u003e\n```\n\n## API\n\n### Render all pages\n\n```javascript\nconst pdfToImage = new PdfToImage();\n\npdfToImage.addListener('page', result =\u003e {\n/*\n * result includes:\n * - pageNum: Number: The page number\n * - blob: Blob: A JPEG image blob of each page\n */\n});\n\npdfToImage.addListener('finish', () =\u003e {\n// called when all pages have finished rendering\n});\n\npdfToImage.addListener('error', err =\u003e {\n// called if an error occurred during rendering\n});\n\n// Where file is PDF File created by a FileReader instance\npdfToImage.toImages(file);\n```\n\n### Render specific pages\n\n```javascript\n\n// same as above but print only pages 1,2 \u0026 5\npdfToImage.toImages(file, [1, 2, 5]);\n```\n\n## Running Tests\n\n```bash\n$ sudo npm install \u0026\u0026 npm install -g phantomjs mocha chai\n$ npm test\n```\n\n\n## Contributing?\n\n```bash\n# Install deps\n$ sudo npm install -g mocha chai babel-cli concat-cli xo\n\n# Run linter\n$ npm run lint\n\n# - Transpile src/pdf-to-image.js from ES2016 -\u003e ES5 and..\n# - Bundle it together with all .js files in src/lib/ and put it in dist/\n$ npm run build\n```\n\n### Gotchas\n\n- Always write tests in ES5 as [PhantomJS][4] which is the headless test env.\ndoes not support ES6. Read [here][5] for more details.\n\n## Authors\n\n- Nicholas Kyriakides, [@nicholaswmin][6], \u003cnik.kyriakides@gmail.com\u003e\n\n## Owners\n\n- [The Profs LTD][7]\n\n## License\n\nAll portions of the source code are proprietary,\nexcluding third-party libraries.\n\n\n[1]: https://mozilla.github.io/pdf.js/\n[2]: https://github.com/mozilla/pdfjs-dist\n[3]: https://cdnjs.cloudflare.com/ajax/libs/pdf.js/1.8.428/pdf.min.js\n[4]: http://phantomjs.org/\n[5]: https://github.com/nathanboktae/mocha-phantomjs/issues/218\n[6]: https://github.com/nicholaswmin\n[7]: https://github.com/TheProfs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheprofs%2Fpdf-to-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheprofs%2Fpdf-to-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheprofs%2Fpdf-to-image/lists"}