{"_id":"image-to-pdf","_rev":"5-5c518030776b5cc49882a02d23d139b5","name":"image-to-pdf","dist-tags":{"latest":"3.0.2"},"versions":{"1.0.0":{"name":"image-to-pdf","version":"1.0.0","keywords":["pdf","image"],"license":"ISC","_id":"image-to-pdf@1.0.0","maintainers":[{"name":"devicarus","email":"me@devicarus.eu"}],"dist":{"shasum":"e1efe6d435b03c634131deb7bae55f290167498c","tarball":"https://registry.npmjs.org/image-to-pdf/-/image-to-pdf-1.0.0.tgz","fileCount":5,"integrity":"sha512-4/SNm7hzm9Xx2i2FlepZG2q3ezQT2m9BDLFgtyihXG6tNd9S5z5himtz9A2+6bhJQQ+/PE2eL+g8bRwAyVuUfA==","signatures":[{"sig":"MEQCIBZZBBoVDA8V3trjbeKr4yGCgDgviEZXVxLDjNT4LUN7AiBqxddic3cvHAwMJ+KiKgxHSBKrS+NPUU3SdQs+bd3ktQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefME5CRA9TVsSAnZWagAAtHoP/0zXEbLlKbx7v7ovNpAa\nr1M9G8VSDKlgNy4x1AMglJj75reZjSKy8Tm+DrBckiOYndH7Af9ouBfMk0tG\n6Uc0H0XEF1jvLwNcbLLK2oXZEwhKzMHOL+PRe5XymEfj1xM72BoBgA7lUEu1\ntKJ0LAHHCaUj0V8AB9yt51CotZClAqq9kL2RxZk6OiHuWnwgKTpdih18Py90\ndSeQqnxrxDbZVA8Kc5skHqpvUCC7pBxjjyLzuJwIW9TBLFd+o+lVnwRiQHCc\nnhGvZ912BJXUbAuWMWtxvN6fQeMEChGUTSi5OZ0nwfpMy1GrUiXE52nNCOwN\nKo/TtPCMZoat+jAR5jKnuG9kBJFVHsMHPofRm+vvO6cN5dudY9tw/RI4NjZC\ndZP1pjkftDoz77XlENyarqBQv69cMCEd978lt/RWTB1TYwDSqs0QmIvsXWB5\noBfdWxl3HOO9a4jWIZiLiohsVfshbk18sfdyhUlbTk/r70y7BsbQ6coaq5Od\nogFolnNpA3iRgugj7PWfWo8hXE8ak5XFTlztxYCzPFW5/nPkR9eH7djzYXSJ\ntXHLZjCB2WVVcwb/DLi23Of5zXUebVDtIgJaYc0Fpsh448VSOvB+i7uqmjxh\nB4+BBFkwhhrx6rWeGxtpx4BgWvD3haRFYAA9kFU+cfhhFfU76vElnXrT0tkX\ndC6Y\r\n=ddLY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"main.js","_npmUser":{"name":"devicarus","email":"me@devicarus.eu"},"repository":{"url":"https://github.com/DEVICARUS/image-to-pdf.git","type":"git"},"description":"Creates a PDF file out of images","directories":{},"dependencies":{"pdfkit":"^0.11.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/image-to-pdf_1.0.0_1585234232858_0.2502844764801708","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"image-to-pdf","version":"2.0.0","keywords":["pdf","image"],"author":{"url":"https://github.com/devicarus","name":"devicarus","email":"devicarus@icloud.com"},"license":"ISC","_id":"image-to-pdf@2.0.0","maintainers":[{"name":"devicarus","email":"devicarus@icloud.com"}],"dist":{"shasum":"58ce2f42ed4f4edf24ff828a43096332cc047485","tarball":"https://registry.npmjs.org/image-to-pdf/-/image-to-pdf-2.0.0.tgz","fileCount":5,"integrity":"sha512-LgD++wJQ8euCjo1cxcfECOyYtPFJZiZEUaknSWjuVbz37meYURW3A8gF+72QiQuWywAm5DLFxuggOu9+ZTxAfQ==","signatures":[{"sig":"MEUCIGFViu91pmTeMq2by/jdqeJbvtfWOgKkYLLYk3iirfhmAiEA8y7pSrktaJKxVAhqp3XRiPPpGhSh+l3u7Tjx6VoBFg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjA7htACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsrA/+MVldC5bCVW7evIWYfcWjT8IeIx+SiB3kyaHpeX6dPhojm/Pc\r\nj14p4yUPNjwBGLjD5vYCISNETzBnK6BMhIVDNMMFle8H/R7qfqM/DC9QX2Om\r\nD9kEKRn8DfukKoE+U6qojigyZURYtxk8gRwJw3n27HD96xCP66qyDWGjtGW+\r\nF1Q3yNBhASxCDKwBBGAq24BQaIO27BNBJ5IKkbECk9qgOqbOcO+9gT4YSMyL\r\naDsiVqCvqgy/sNcmERGJBHtk/bVlh34Q+yZO5vTHvszlPJwIEOqgN6OZLkOG\r\n5HV06UHGX8NC9VMokXahhRafOIByq2lBmgGAzUX9qmCaqT6qhQMvTnzSXaIn\r\nYuYYXStbOFTnBKKPdV1qvvYDbLyhuaMUbByd9BVlmN0Z/40VEBJhcCskzJI7\r\nCHuUngwzx/DpJ49rMlavvWLdB9hQE8DFiwmcrL7O81JfU4UlS2MpZ0hOfSuQ\r\nWjL5cgV+YxAJYsjsfK9s7B75L8dePyrKZyvBtMstr0E6N2+cVfX3Pm9Lpm8r\r\n0V3+cWp+H49hPx/OuCyzNq1UtF1F5hVOgA0p3zio4179eija/81ZhuazDSfW\r\nu2xjP9Jr1QQDLan8CJ0C7HskJ7jewGRrM7+ggfEqObPdz5wKCbh4bTjYdrib\r\niErW4W/krvaLgb55v84P/pcFibigoitj/7s=\r\n=Sm+c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"main.js","_npmUser":{"name":"devicarus","email":"devicarus@icloud.com"},"repository":{"url":"https://github.com/devicarus/image-to-pdf.git","type":"git"},"description":"A simple image to PDF converter","directories":{},"dependencies":{"pdfkit":"^0.13.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/image-to-pdf_2.0.0_1661188205794_0.6313930149031175","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"image-to-pdf","version":"3.0.0","keywords":["pdf","image"],"author":{"url":"https://github.com/devicarus","name":"devicarus","email":"devicarus@icloud.com"},"license":"ISC","_id":"image-to-pdf@3.0.0","maintainers":[{"name":"devicarus","email":"devicarus@icloud.com"}],"homepage":"https://github.com/devicarus/image-to-pdf#readme","bugs":{"url":"https://github.com/devicarus/image-to-pdf/issues"},"dist":{"shasum":"57e5835783479f1b93f8b8aa5997432b18b7418c","tarball":"https://registry.npmjs.org/image-to-pdf/-/image-to-pdf-3.0.0.tgz","fileCount":17,"integrity":"sha512-jb7Dobc2A73lOYNmhgTwGDbTEOuKmEGOFi/5SCAqyJskc0gqgHApWzLggGN6f75CdV+bpRqkcC6xkjs6F72agw==","signatures":[{"sig":"MEUCIGGCShMl3x7Wu4iriWo5Svv1jAIyhjg5OU72FAQM8YxRAiEAoalR+gj7gtJ4p/zJ/213S5jG1wpVtxmmK5evOaZUkXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12044},"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","source":"index.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"50301aa6107858ab3d17f40a05e039a8535bdbcd","scripts":{"build":"npm run build:esm && npm run build:cjs","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"devicarus","email":"devicarus@icloud.com"},"repository":{"url":"git+https://github.com/devicarus/image-to-pdf.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple image to PDF converter","directories":{},"_nodeVersion":"20.18.1","dependencies":{"pdfkit":"^0.15.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/pdfkit":"^0.13.8"},"_npmOperationalInternal":{"tmp":"tmp/image-to-pdf_3.0.0_1734867090552_0.865405495972051","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"image-to-pdf","version":"3.0.1","keywords":["pdf","image"],"author":{"url":"https://github.com/devicarus","name":"devicarus","email":"devicarus@icloud.com"},"license":"ISC","_id":"image-to-pdf@3.0.1","maintainers":[{"name":"devicarus","email":"devicarus@icloud.com"}],"homepage":"https://github.com/devicarus/image-to-pdf#readme","bugs":{"url":"https://github.com/devicarus/image-to-pdf/issues"},"dist":{"shasum":"ab3d94dd71375461783430b361fcbc3524e6e8d2","tarball":"https://registry.npmjs.org/image-to-pdf/-/image-to-pdf-3.0.1.tgz","fileCount":17,"integrity":"sha512-rLSRo1KCmHaP1gKqaqE68tYgU3pc2KW/5q5eGUjRR+Mc5fT8TdJxrd8TkG3Ah00/3VseDaZsb6W8oHha69Mlog==","signatures":[{"sig":"MEUCIFcUawPOB/b+ldIwi720tKcnQeypzZY+EozPFsuRyQiwAiEA5dtUxcXQXqWA7yalrwwXbdDjN6DWLzsitjQ7X518EhY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12106},"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","source":"index.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"5ba480fe0e53a8ce02d2acc48ab3f2bd1c48bd43","scripts":{"build":"npm run build:esm && npm run build:cjs","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"devicarus","email":"devicarus@icloud.com"},"repository":{"url":"git+https://github.com/devicarus/image-to-pdf.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple image to PDF converter","directories":{},"_nodeVersion":"20.18.1","dependencies":{"pdfkit":"^0.15.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/pdfkit":"^0.13.8"},"_npmOperationalInternal":{"tmp":"tmp/image-to-pdf_3.0.1_1735125578129_0.32437633457756143","host":"s3://npm-registry-packages-npm-production"}},"3.0.2":{"name":"image-to-pdf","version":"3.0.2","description":"A simple image to PDF converter","author":{"name":"devicarus","email":"devicarus@icloud.com","url":"https://github.com/devicarus"},"keywords":["pdf","image"],"repository":{"type":"git","url":"git+https://github.com/devicarus/image-to-pdf.git"},"source":"index.ts","main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"scripts":{"build:esm":"tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > dist/esm/package.json","build:cjs":"tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","build":"npm run build:esm && npm run build:cjs"},"license":"ISC","dependencies":{"pdfkit":"^0.15.2"},"devDependencies":{"@types/pdfkit":"^0.13.8","typescript":"^5.7.2"},"_id":"image-to-pdf@3.0.2","gitHead":"c29f883ced8243a0c7e3a640742a8e78b76c3a66","bugs":{"url":"https://github.com/devicarus/image-to-pdf/issues"},"homepage":"https://github.com/devicarus/image-to-pdf#readme","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-6/IQCt4f384zjQ1w8P7FHIN/tF0mau8RbAIydT/+wyfZ1RAb8E2fiKe9t/k0V880h0d3zRpw9Q1bM5AIgVL/4g==","shasum":"313e86747c2e04216b9f40d20d3c7d43a4cce5d1","tarball":"https://registry.npmjs.org/image-to-pdf/-/image-to-pdf-3.0.2.tgz","fileCount":15,"unpackedSize":14017,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9fx1wQDEgETAuo7JiAnrcI5fyGFN70JXT0vHIvptbpQIhAMf6Drg8HC6efLbJJ5x//5cZgBMjq2ocDPQ+eZhkpG0E"}]},"_npmUser":{"name":"devicarus","email":"devicarus@icloud.com"},"directories":{},"maintainers":[{"name":"devicarus","email":"devicarus@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/image-to-pdf_3.0.2_1736458984655_0.6056593518820972"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-26T14:50:32.858Z","modified":"2025-01-09T21:43:04.983Z","1.0.0":"2020-03-26T14:50:32.989Z","2.0.0":"2022-08-22T17:10:05.960Z","3.0.0":"2024-12-22T11:31:30.763Z","3.0.1":"2024-12-25T11:19:38.296Z","3.0.2":"2025-01-09T21:43:04.817Z"},"bugs":{"url":"https://github.com/devicarus/image-to-pdf/issues"},"author":{"name":"devicarus","email":"devicarus@icloud.com","url":"https://github.com/devicarus"},"license":"ISC","homepage":"https://github.com/devicarus/image-to-pdf#readme","keywords":["pdf","image"],"repository":{"type":"git","url":"git+https://github.com/devicarus/image-to-pdf.git"},"description":"A simple image to PDF converter","maintainers":[{"name":"devicarus","email":"devicarus@icloud.com"}],"readme":"<div align=\"center\">\n\n### Welcome to image-to-pdf 👋\n\n> A simple 🖼️ to 📄 converter for NodeJS\n\n<br>\n\n<img alt=\"Version\" src=\"https://img.shields.io/github/package-json/v/devicarus/image-to-pdf?style=for-the-badge\" />\n\n</div>\n\n---\n\n## Instalation\n```sh\nnpm install image-to-pdf\n```\n\n## Example (CommonJS)\n```js\nconst { convert, sizes } = require('image-to-pdf');\nconst fs = require('fs')\n\nconst pages = [\n    \"./pages/image1.jpeg\", // path to the image\n    \"data:image/png;base64,iVBORw...\", // base64\n    fs.readFileSync('./pages/image3.png') // Buffer\n]\n \nconvert(pages, sizes.A4).pipe(fs.createWriteStream('output.pdf'))\n```\n\n## Example (ECMAScript)\n```js\nimport imageToPDF, { sizes } from 'image-to-pdf';\nimport fs from 'fs';\n\nlet pages = fs.readdirSync('./img').map(file => `./img/${file}`);\n\nimageToPDF(pages, sizes.A4).pipe(fs.createWriteStream('output-esm.pdf'));\n```\n\n## Example (TypeScript)\n```js\nconst imageToPDF = require('image-to-pdf').default;\nconst fs = require('fs');\n\nlet pages: string[] = fs.readdirSync('./img').map((file: string) => `./img/${file}`);\n// Alternatively you can also pass the size as a string like this:\nimageToPDF(pages, 'A4').pipe(fs.createWriteStream('output-ts.pdf'));\n```\n\n## Documentation\n### Accepted formats\nThe only accepted image formats are `png` and `jpeg`. They can be passed to the function as `base64`, `Buffer` or simply as a path to the file (see [Example](#example)).\n\n### Page size\nA list of all size presets in `sizes` can be found [here](sizes.json). A custom size can be passed to the function simply as `[x, y]`.\n\n### Output\nThe function returns a `Stream` (see [official documentation](https://nodejs.org/api/stream.html)). The easiest way to get a file is to `pipe` it into a `WriteStream` (see [Example](#example)).\n","readmeFilename":"README.md"}