{"_id":"@brakebein/pdf2png","_rev":"2-9198debaff770b38a129381e1683b3d2","name":"@brakebein/pdf2png","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@brakebein/pdf2png","version":"1.0.0","keywords":["convert","pdf","png","pdf2png","image","ghostscript"],"author":{"name":"Brakebein"},"license":"MIT","_id":"@brakebein/pdf2png@1.0.0","maintainers":[{"name":"brakebein","email":"bruschie@hotmail.com"}],"homepage":"https://github.com/Brakebein/pdf2png","bugs":{"url":"https://github.com/Brakebein/pdf2png/issues"},"dist":{"shasum":"c4e0680d8edb517d533c78d5c0a3b175465c6caf","tarball":"https://registry.npmjs.org/@brakebein/pdf2png/-/pdf2png-1.0.0.tgz","fileCount":13,"integrity":"sha512-GyDRNPWHSM2kDwRSXOATqg7i0IJZSK/11n+tMgE6hMWJw1c7JseVttmRibER+ycfYbqmwnwcVpCNIEE1oPp+wA==","signatures":[{"sig":"MEQCIDVIWsMV/TM+sqIDnrTdZbwFcayqzju8YzgYRDxZ+ut8AiATJNeJrct+3fuGiS+43Xr2U10xqYzqlKNKzOMOk8Xm+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22591052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTuC1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBSQ//T4u7k4lLNKRtaKYYFgNY3ITwvoLBFiG/8oD3zME1xy2DH3ZD\r\nOjtGgAuRRPqhJhqLOI6tJN4dW7gU/Z0rT0JgU7Rbjhgpq2ahZqHgSg1ERCNk\r\nPwFIMdWPbcLszK/FC8ngQK9gxg+tCGXYk3zivOZs0XkVr3rrHjvuPZulZmEJ\r\nTNbKZ4acOiwtZAdtyP7su4EL0fyjsJrDalODzDU+3hc+0cezWz3Ey1+ygCHf\r\nbSLzwmkq0HLH8vimJMWDQuR4BuKX3+tvlgixIOVgMXyOpj0AavSYvA2QyTn6\r\nrd4Uk0imkRtgMwbABbr9B1RIGCSlFyUIhYkZWRM4sWqShH37NhOoe+60VVN9\r\njVNrf5lPsMZMCiXU4vElSI7yyODrMRrNaM9ZbM7duXjTbivXHUHBnBAqFzSG\r\n756lb2DhsCuVtFCsWu1F9DKwKwshgUU58MUFL7u4wiGCybl0AXjGYjZvosjr\r\nv3jjRZxhR6Fw/Y8MzLBBp/6EhaOmt35hp28Hi+Hqytkj9oCVgwtsbvD0gOoO\r\njqTs9WVVqdoNxKRUA4QnhnVTRxS2eG2FMXYKMjHiBn0JITLTxM8pnzzYbKd5\r\nc0WtqLLeudWQjzkcfpawK5HmcX+kLQ+yVEilu/fivmnCGCJhmYR+AK4zE766\r\nj/e6T7iXk8CPD6NMFBpFB6ajB3lLlJRpqpE=\r\n=jlDi\r\n-----END PGP SIGNATURE-----\r\n"},"type":"module","types":"types/index.d.ts","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"3137c61367ede3d239572b2cd35c4ec6bb9eec47","scripts":{"test":"ava","build":"npx rollup -c && npm run build:types","prebuild":"npm run cleanup:build","build:types":"npx tsc -d --emitDeclarationOnly --declarationDir types","cleanup:build":"rimraf dist types"},"_npmUser":{"name":"brakebein","email":"bruschie@hotmail.com"},"repository":{"url":"git+https://github.com/Brakebein/pdf2png.git","type":"git"},"_npmVersion":"8.4.0","description":"Convert pages of a PDF document to PNG images","directories":{},"_nodeVersion":"18.7.0","dependencies":{"axios":"^0.27.2","tmp-promise":"^3.0.0","child-process-promise":"^2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^4.3.3","eslint":"^8.24.0","rimraf":"^3.0.2","rollup":"^2.77.3","ts-node":"^10.9.1","prettier":"^2.7.1","@types/tmp":"^0.2.3","typescript":"^4.4.3","@types/node":"^16.9.1","@types/axios":"^0.14.0","rollup-plugin-copy":"^3.4.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@rollup/plugin-typescript":"^8.3.4","@typescript-eslint/parser":"^5.0.0","@rollup/plugin-node-resolve":"^14.1.0","@types/child-process-promise":"^2.2.2","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/pdf2png_1.0.0_1666113717180_0.9260409621107213","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@brakebein/pdf2png","version":"1.1.0","description":"Convert pages of a PDF document to PNG images","keywords":["convert","pdf","png","pdf2png","image","ghostscript"],"author":{"name":"Brakebein"},"repository":{"type":"git","url":"git+https://github.com/Brakebein/pdf2png.git"},"homepage":"https://github.com/Brakebein/pdf2png","bugs":{"url":"https://github.com/Brakebein/pdf2png/issues"},"license":"MIT","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"types":"types/index.d.ts","type":"module","scripts":{"cleanup:build":"rimraf dist types","prebuild":"npm run cleanup:build","build":"npx rollup -c && npm run build:types","build:types":"npx tsc -d --emitDeclarationOnly --declarationDir types","test":"ava"},"dependencies":{"axios":"^1.8.4","tmp-promise":"^3.0.0"},"devDependencies":{"@rollup/plugin-node-resolve":"^16.0.1","@rollup/plugin-typescript":"^12.1.2","@types/node":"^16.9.1","@types/tmp":"^0.2.3","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","ava":"^6.2.0","eslint":"^8.24.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","prettier":"^2.7.1","rimraf":"^6.0.1","rollup":"^3.29.5","rollup-plugin-copy":"^3.4.0","ts-node":"^10.9.1","typescript":"^5.4.0"},"_id":"@brakebein/pdf2png@1.1.0","gitHead":"ee5553dafbcd1cf4d91c8ee8cb6d6a538406f213","_nodeVersion":"20.12.2","_npmVersion":"10.9.2","dist":{"integrity":"sha512-n6gBcQxRWa67TNYj0SZc7FhrdGNW3RoYIj5dwxsA4acMfnrMBwRMV1SqyAvBmrSZg4WC1iOPv2jCNiYx6og3Xw==","shasum":"4229da6360d4856aa944405a01b504fa553cce4a","tarball":"https://registry.npmjs.org/@brakebein/pdf2png/-/pdf2png-1.1.0.tgz","fileCount":14,"unpackedSize":22593806,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFiF6O4g+DA7ji72q/FZ2cNi858TelmD5yIU3KxAUkYBAiB3d6Y5JD5cN4ZN/NVm2yleHS8K4Qr93iFgHF2nvMNL5A=="}]},"_npmUser":{"name":"brakebein","email":"bruschie@hotmail.com"},"directories":{},"maintainers":[{"name":"brakebein","email":"bruschie@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pdf2png_1.1.0_1743618883105_0.10614196190509984"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-18T17:21:57.128Z","modified":"2025-04-02T18:34:44.731Z","1.0.0":"2022-10-18T17:21:57.778Z","1.1.0":"2025-04-02T18:34:44.552Z"},"bugs":{"url":"https://github.com/Brakebein/pdf2png/issues"},"author":{"name":"Brakebein"},"license":"MIT","homepage":"https://github.com/Brakebein/pdf2png","keywords":["convert","pdf","png","pdf2png","image","ghostscript"],"repository":{"type":"git","url":"git+https://github.com/Brakebein/pdf2png.git"},"description":"Convert pages of a PDF document to PNG images","maintainers":[{"name":"brakebein","email":"bruschie@hotmail.com"}],"readme":"# pdf2png\n\nThis is a fork of [tr3ysmith/Pdf2Png](https://github.com/tr3ysmith/Pdf2Png).\nAlong with the usage of TypeScript and promises, this version:\n\n- adds support to read PDF file from local file system\n- properly compiles to both CommonJS and ESM\n\n## Install\n\n```bash\n$ npm install @brakebein/pdf2png\n```\n\n## Setup\n\n### Windows\n\nNo additional setup is needed for Windows, ghostscript is included with this package.\n\n### Linux\n\nIf you want to use it with linux, you will need to install ghostscript via your package manager.\n\n```bash\n$ sudo apt-get update\n$ sudo apt-get install ghostscript\n```\n\n### Mac OSX\n\nYou will need to install ghostscript on Mac using brew.\n\n```bash\n$ brew install ghostscript\n```\n\n## Usage\n\n```typescript\nimport { PdfConvert, PdfConvertOptions } from '@brakebein/pdf2png';\n\n// create a PdfConvert object for a PDF file\n// using a Buffer\nconst pdfConverter = new PdfConvert(buffer);\n// using a Web url\nconst pdfConverter = new PdfConvert('https://example.com/example.pdf');\n// using a local file\nconst pdfConverter = new PdfConvert('./folder/example.pdf');\n\n// pass options\nconst options: PdfConvertOptions = {\n  // resolution of the output image in dpi\n  resolution: 600,\n  // path to ghostscript bin directory (only Windows)\n  // defaults to executable shipped with this package\n  ghostscriptPath: 'path/to/gs/bin'\n};\nconst pdfConverter = new PdfConvert('./folder/example.pdf', options);\n\n// get the number of pages of the PDF\nconst pages = await pdfConverter.getPageCount();\n\n// get page 1 as a PNG Image Buffer\nconst buffer = await pdfConverter.convertPageToImage(1);\nawait fs.writeFile(\"example_page1.png\", buffer);\n\n// Dispose the converter object when you're done using it, \n// otherwise the pdf tmp file will not be removed\n// (but should be automatically removed on process exit).\n// To manually call `dispose()` allows you to run multiple operations\n// within long-living processes, e.g. backend server, without piling up tmp files.\npdfConverter.dispose();\n```\n","readmeFilename":"README.md"}