{"id":15632360,"url":"https://github.com/fdawgs/node-poppler","last_synced_at":"2026-01-30T11:31:33.146Z","repository":{"id":37768317,"uuid":"214626138","full_name":"Fdawgs/node-poppler","owner":"Fdawgs","description":"Asynchronous Node.js wrapper for the Poppler PDF rendering library","archived":false,"fork":false,"pushed_at":"2025-04-01T18:44:33.000Z","size":91245,"stargazers_count":211,"open_issues_count":5,"forks_count":26,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T04:09:16.114Z","etag":null,"topics":["async","attach","cairo","converter","detach","html","pdf","pdf-converter","pdf-to-cairo","pdf-to-html","pdf-to-image","pdf-to-ppm","pdf-to-ps","poppler","ppm","ps","separate","text","txt","unite"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/node-poppler","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fdawgs.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Fdawgs"}},"created_at":"2019-10-12T10:16:47.000Z","updated_at":"2025-04-06T16:50:34.000Z","dependencies_parsed_at":"2023-12-18T18:56:28.318Z","dependency_job_id":"9dc584a6-f455-4ca7-9415-b9001d30155f","html_url":"https://github.com/Fdawgs/node-poppler","commit_stats":{"total_commits":1009,"total_committers":13,"mean_commits":77.61538461538461,"dds":0.3409316154608524,"last_synced_commit":"b221d6d30db58dc0bda262e6ae5a5474802e676d"},"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fdawgs%2Fnode-poppler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fdawgs%2Fnode-poppler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fdawgs%2Fnode-poppler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fdawgs%2Fnode-poppler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fdawgs","download_url":"https://codeload.github.com/Fdawgs/node-poppler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890860,"owners_count":21178522,"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":["async","attach","cairo","converter","detach","html","pdf","pdf-converter","pdf-to-cairo","pdf-to-html","pdf-to-image","pdf-to-ppm","pdf-to-ps","poppler","ppm","ps","separate","text","txt","unite"],"created_at":"2024-10-03T10:43:44.412Z","updated_at":"2026-01-30T11:31:33.141Z","avatar_url":"https://github.com/Fdawgs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Fdawgs"],"categories":[],"sub_categories":[],"readme":"# node-poppler\n\n[![GitHub release](https://img.shields.io/github/release/Fdawgs/node-poppler.svg)](https://github.com/Fdawgs/node-poppler/releases/latest/)\n[![npm version](https://img.shields.io/npm/v/node-poppler)](https://npmjs.com/package/node-poppler)\n[![CI](https://github.com/Fdawgs/node-poppler/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Fdawgs/node-poppler/actions/workflows/ci.yml)\n[![Coverage status](https://coveralls.io/repos/github/Fdawgs/node-poppler/badge.svg?branch=main)](https://coveralls.io/github/Fdawgs/node-poppler?branch=main)\n[![code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)\n\n\u003e Asynchronous Node.js wrapper for the Poppler PDF rendering library\n\n## Overview\n\n[Poppler](https://poppler.freedesktop.org/) is a PDF rendering library that also includes a collection of utility binaries, which allows for the manipulation and extraction of data from PDF documents such as converting PDF files to HTML, TXT, or PostScript.\n\nThe `node-poppler` module provides an asynchronous Node.js wrapper around said utility binaries for easier use.\n\n## Installation\n\nInstall using `npm`:\n\n```bash\nnpm i node-poppler\n```\n\n### Linux and macOS/Darwin support\n\n64-bit Windows binaries are provided via an optional dependency on the [`node-poppler-win32`](https://www.npmjs.com/package/node-poppler-win32) package.\nFor Linux and Mac users, the `poppler-data` and `poppler-utils` binaries binary will need to be installed separately.\n\nAn example of downloading the binaries on a Debian system:\n\n```\nsudo apt-get install poppler-data poppler-utils\n```\n\nFor macOS users, the binaries can be installed with [Homebrew](https://brew.sh/):\n\n```\nbrew install poppler\n```\n\n## Example usage\n\nPlease refer to the [JSDoc comments in the source code](./src/index.js) or the [generated type definitions](https://www.npmjs.com/package/node-poppler?activeTab=code) for information on the available options.\n\n### poppler.pdfToCairo\n\nExample of an `async` `await` call to `poppler.pdfToCairo()`, to convert only the first and second page of a PDF file to PNG:\n\n```js\nconst { Poppler } = require(\"node-poppler\");\n\nconst file = \"test_document.pdf\";\nconst poppler = new Poppler();\nconst options = {\n\tfirstPageToConvert: 1,\n\tlastPageToConvert: 2,\n\tpngFile: true,\n};\nconst outputFile = `test_document.png`;\n\nconst res = await poppler.pdfToCairo(file, outputFile, options);\nconsole.log(res);\n```\n\nExample of an `async` `await` call to `poppler.pdfToCairo()`, to convert only the first page of a PDF file to a new\nPDF file using stdout:\n\n```js\nconst { writeFile } = require(\"node:fs/promises\");\nconst { Poppler } = require(\"node-poppler\");\n\nconst file = \"test_document.pdf\";\nconst poppler = new Poppler();\nconst options = {\n\tlastPageToConvert: 1,\n\tpdfFile: true,\n};\n\nconst res = await poppler.pdfToCairo(file, undefined, options);\n// pdfToCairo writes to stdout using binary encoding if pdfFile or singleFile options are used\nawait writeFile(\"new_file.pdf\", res, { encoding: \"binary\", flush: true });\n```\n\n### poppler.pdfToHtml\n\nExample of calling `poppler.pdfToHtml()` with a promise chain:\n\n```js\nconst { Poppler } = require(\"node-poppler\");\n\nconst file = \"test_document.pdf\";\nconst poppler = new Poppler();\nconst options = {\n\tfirstPageToConvert: 1,\n\tlastPageToConvert: 2,\n};\n\npoppler\n\t.pdfToHtml(file, undefined, options)\n\t.then((res) =\u003e {\n\t\tconsole.log(res);\n\t})\n\t.catch((err) =\u003e {\n\t\tconsole.error(err);\n\t\tthrow err;\n\t});\n```\n\nExample of calling `poppler.pdfToHtml()` with a promise chain, providing a Buffer as an input:\n\n```js\nconst { readFileSync } = require(\"node:fs\");\nconst { Poppler } = require(\"node-poppler\");\n\nconst file = readFileSync(\"test_document.pdf\");\nconst poppler = new Poppler();\nconst options = {\n\tfirstPageToConvert: 1,\n\tlastPageToConvert: 2,\n};\n\npoppler\n\t.pdfToHtml(file, \"tester.html\", options)\n\t.then((res) =\u003e {\n\t\tconsole.log(res);\n\t})\n\t.catch((err) =\u003e {\n\t\tconsole.error(err);\n\t\tthrow err;\n\t});\n```\n\n### poppler.pdfToText\n\nExample of calling `poppler.pdfToText()` with a promise chain:\n\n```js\nconst { Poppler } = require(\"node-poppler\");\n\nconst file = \"test_document.pdf\";\nconst poppler = new Poppler();\nconst options = {\n\tfirstPageToConvert: 1,\n\tlastPageToConvert: 2,\n};\nconst outputFile = \"test_document.txt\";\n\npoppler\n\t.pdfToText(file, outputFile, options)\n\t.then((res) =\u003e {\n\t\tconsole.log(res);\n\t})\n\t.catch((err) =\u003e {\n\t\tconsole.error(err);\n\t\tthrow err;\n\t});\n```\n\n## Contributing\n\nContributions are welcome, and any help is greatly appreciated!\n\nSee [the contributing guide](https://github.com/Fdawgs/.github/blob/main/CONTRIBUTING.md) for details on how to get started.\nPlease adhere to this project's [Code of Conduct](https://github.com/Fdawgs/.github/blob/main/CODE_OF_CONDUCT.md) when contributing.\n\n## Acknowledgements\n\n- [**Albert Astals Cid**](https://github.com/albert-astals-cid-kdab) - [Poppler](https://poppler.freedesktop.org/) developer\n\n## License\n\n`node-poppler` is licensed under the [MIT](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdawgs%2Fnode-poppler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdawgs%2Fnode-poppler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdawgs%2Fnode-poppler/lists"}