{"_id":"@coderosh/images-to-pdf","_rev":"4-e0a0caef9e572ce5505578e6c009df9c","name":"@coderosh/images-to-pdf","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"@coderosh/images-to-pdf","version":"1.0.0","description":"Combine images to a single pdf on browser and node","main":"dist/index.js","type":"module","license":"MIT","scripts":{"watch":"tsc -w","build":"tsc","lint":"eslint src/**.ts","test":"jest","clean":"rimraf dist","cb":"yarn clean && yarn build","prepublishOnly":"yarn lint && yarn test && yarn cb"},"engines":{"node":">=12"},"devDependencies":{"@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","axios":"^0.24.0","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.23.4","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-promise":"^5.1.0","jest":"^27.0.4","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4","yorkie":"^2.0.0"},"gitHooks":{"pre-commit":"lint-staged && yarn cb && yarn test && git add ."},"lint-staged":{"*.ts":["eslint --fix"]},"author":{"name":"Roshan Acharya","email":"acharyaroshan2357@gmail.com"},"homepage":"https://github.com/coderosh/images-to-pdf#readme","bugs":{"url":"https://github.com/coderosh/images-to-pdf/issues"},"repository":{"type":"git","url":"git+https://github.com/coderosh/images-to-pdf.git"},"dependencies":{"@coderosh/image-size":"^2.0.0","pdf-lib":"^1.17.0"},"gitHead":"c2cadbbe40fbe47fc714216041d6ead8252ab968","_id":"@coderosh/images-to-pdf@1.0.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-X43PtmudwpILzcnyM8JpxySbE3Jw7pXstAOavESQbtXPZr3RVU5wBm86N1feF6gmr3HN6FYv+qMCu3ATPS54HQ==","shasum":"247e074559bd31f7fdc98a9a428411d4946c2940","tarball":"https://registry.npmjs.org/@coderosh/images-to-pdf/-/images-to-pdf-1.0.0.tgz","fileCount":9,"unpackedSize":9191,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2+Us51nQ6+ViTDnoZSYwDABzMpLMA/NK/T09GIl/riAiEAlyuH4Sk7UV0MkOaMwG/awvxqgCNJB15TjGx5ZTDGVr0="}]},"_npmUser":{"name":"coderosh","email":"acharyaroshan2357@gmail.com"},"directories":{},"maintainers":[{"name":"coderosh","email":"acharyaroshan2357@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/images-to-pdf_1.0.0_1635433773566_0.7687075532548686"},"_hasShrinkwrap":false},"2.0.0":{"name":"@coderosh/images-to-pdf","version":"2.0.0","description":"Combine images to a single pdf on browser and node","main":"dist/index.js","type":"module","license":"MIT","scripts":{"watch":"tsc -w","build":"tsc","lint":"eslint src/**.ts","test":"jest","clean":"rimraf dist","cb":"yarn clean && yarn build","prepublishOnly":"yarn lint && yarn test && yarn cb"},"engines":{"node":">=12"},"devDependencies":{"@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","axios":"^0.24.0","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.23.4","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-promise":"^5.1.0","jest":"^27.0.4","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4","yorkie":"^2.0.0"},"gitHooks":{"pre-commit":"lint-staged && yarn cb && yarn test && git add ."},"lint-staged":{"*.ts":["eslint --fix"]},"author":{"name":"Roshan Acharya","email":"acharyaroshan2357@gmail.com"},"homepage":"https://github.com/coderosh/images-to-pdf#readme","bugs":{"url":"https://github.com/coderosh/images-to-pdf/issues"},"repository":{"type":"git","url":"git+https://github.com/coderosh/images-to-pdf.git"},"dependencies":{"@coderosh/image-size":"^2.0.0","jspdf":"^2.4.0"},"gitHead":"5e601fbd5f84a8da485a2e198a98fa09ac598037","_id":"@coderosh/images-to-pdf@2.0.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Fc0GsBVCCDDrzn8h1wzqxG7bf7YAgnWJLRiSs0aj1RnJhIuKiSmQTjLH7W8NoYPqGTp517TY0Qr/8p+8PFRVsg==","shasum":"c0cb57d7b6f51ac2f69f6246afe5e46ec18dcf6f","tarball":"https://registry.npmjs.org/@coderosh/images-to-pdf/-/images-to-pdf-2.0.0.tgz","fileCount":9,"unpackedSize":7833,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGdiKVEjxDluET1sav6tNYfgWkZgx+kNBpbckwdebO61AiEAhfvYEsDgbnTA6DnVZKvSmnP0HVJ0twv1oXvPJao9kKI="}]},"_npmUser":{"name":"coderosh","email":"acharyaroshan2357@gmail.com"},"directories":{},"maintainers":[{"name":"coderosh","email":"acharyaroshan2357@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/images-to-pdf_2.0.0_1635659420244_0.9933446875071448"},"_hasShrinkwrap":false},"2.1.0":{"name":"@coderosh/images-to-pdf","version":"2.1.0","description":"Combine images to a single pdf on browser and node","main":"dist/index.js","type":"module","license":"MIT","scripts":{"watch":"tsc -w","build":"tsc","lint":"eslint src/**.ts","test":"jest","clean":"rimraf dist","cb":"yarn clean && yarn build","prepublishOnly":"yarn lint && yarn test && yarn cb"},"engines":{"node":">=12"},"devDependencies":{"@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","axios":"^0.24.0","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.23.4","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-promise":"^5.1.0","jest":"^27.0.4","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4","yorkie":"^2.0.0"},"gitHooks":{"pre-commit":"lint-staged && yarn cb && yarn test && git add ."},"lint-staged":{"*.ts":["eslint --fix"]},"author":{"name":"Roshan Acharya","email":"acharyaroshan2357@gmail.com"},"homepage":"https://github.com/coderosh/images-to-pdf#readme","bugs":{"url":"https://github.com/coderosh/images-to-pdf/issues"},"keywords":["pdf","images-to-pdf","pdf-converter","pdf-from-images"],"repository":{"type":"git","url":"git+https://github.com/coderosh/images-to-pdf.git"},"dependencies":{"@coderosh/image-size":"^2.0.0","jspdf":"^2.4.0"},"gitHead":"c781cc450b97358b098d3867c7f7405a5f729347","_id":"@coderosh/images-to-pdf@2.1.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-mFKLjy7ZOz0utOfQGO6LzvCr23Q0nfkPjwUzVK3pfGEzvr1tdLJc87jZLTiVKM9BdOZXyIlGETBTLLjr+dAPmQ==","shasum":"511052f774a149685e793b79a6ef402f55ca161b","tarball":"https://registry.npmjs.org/@coderosh/images-to-pdf/-/images-to-pdf-2.1.0.tgz","fileCount":9,"unpackedSize":8263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzdK3CRA9TVsSAnZWagAAsKwQAJYj5c7VTXZL5w/9z3dz\nWkkg9CXjcQfwZTzwuhVZH2YbetOF4Bzp5N8JLS3BtuGbpgJCBJQCd9iDX5ay\nXebi59Ff8kOVATbX0uQhFU4sydHVESfRjfcFBExJ5uf2Yokpo7ClFYkXwMFy\nA3QsPD+UzPBsC7T849oJRyiESjqsSr4nRq4H/E0QYT0kROCaZJrbKndcqp8s\ngPNNXhqni62Fkpd922aQNhPC92PYQ5fKqU87X7Y58DER10dZMEXYt4mxra8P\nxfj+KDRM+vaTRRfHSnPXKjzdMPO5kVDZWtoCojOQFXTwI/9q3qATlEyGEVyi\nlQv4ySUoXMGBPgOV5IZnGgIwDmM/SP/SGXSxE/itMWJrL1NQrlr6AX2xCet7\nMMlYoMJ1+zyoJ9ExYeqKrhlBtLb401f9yeLJCX6SFNw4fWaedDhX6JavV6se\nzqJCclCWNoN42flSqGhuPilpQOBdHfZ1lZkPnDzpC3PWHQ+hB3gqi1+M/EyL\nFLnqEvLKYH3bhjKFu2W6M8OukWzIxf1VRXwpRXEAsfffEGLrDco0Ja/TgqID\n0CxLIdSCs1OZDKjoOI6HgxdGxtw9UEP3ocjQwqKJ4MsSrBj2H3PXNCJPGiWq\nMRPaf8C5RAprMxYQUKKYhRVZ8xffR2nDogBx9u0Vf9nAhrDYHcwmQyew/WvN\nuGHH\r\n=1Z+r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBtCrxTj8H4RMQE7tWk33E1WDQvOFhmpIc815saKc9VOAiBI21tzrMu+zDHxDsJPkODYUWOEJc0BQSZvpUoVi5iFiQ=="}]},"_npmUser":{"name":"coderosh","email":"acharyaroshan2357@gmail.com"},"directories":{},"maintainers":[{"name":"coderosh","email":"acharyaroshan2357@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/images-to-pdf_2.1.0_1636778305810_0.24074197852665802"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-28T15:09:33.523Z","1.0.0":"2021-10-28T15:09:33.707Z","modified":"2022-04-05T00:05:33.323Z","2.0.0":"2021-10-31T05:50:20.436Z","2.1.0":"2021-11-13T04:38:26.004Z"},"maintainers":[{"name":"coderosh","email":"acharyaroshan2357@gmail.com"}],"description":"Combine images to a single pdf on browser and node","homepage":"https://github.com/coderosh/images-to-pdf#readme","repository":{"type":"git","url":"git+https://github.com/coderosh/images-to-pdf.git"},"author":{"name":"Roshan Acharya","email":"acharyaroshan2357@gmail.com"},"bugs":{"url":"https://github.com/coderosh/images-to-pdf/issues"},"license":"MIT","readme":"# images-to-pdf\r\n\r\n> Combine images to a single pdf. Works on both browser and node.\r\n\r\n<a href=\"https://npmjs.com/package/@coderosh/images-to-pdf\"><img alt=\"NPM\" src=\"https://img.shields.io/npm/v/@coderosh/images-to-pdf\" /></a>\r\n<a href=\"https://github.com/coderosh/images-to-pdf\"><img alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\" /></a>\r\n<a href=\"#\"><img alt=\"CI\" src=\"https://img.shields.io/github/workflow/status/coderosh/images-to-pdf/CI\"></a>\r\n<a href=\"https://github.com/coderosh/images-to-pdf\"><img src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome!\" /></a>\r\n\r\n## Installation\r\n\r\n```sh\r\n# node\r\nnpm install @coderosh/images-to-pdf\r\n\r\n# yarn\r\nyarn add @coderosh/images-to-pdf\r\n```\r\n\r\n## Usage\r\n\r\nThis package requires image to be of type arraybuffer or uint8array.\r\n\r\n- Using `imagesToPDF` function.\r\n\r\n  ```js\r\n  import { imagesToPDF } from '@coderosh/images-to-pdf'\r\n\r\n  const main = async () => {\r\n    const img1 = await fetch('https://img1').then((res) => res.arrayBuffer())\r\n    const img2 = await fetch('https://img2').then((res) => res.arrayBuffer())\r\n\r\n    const pdf = await imagesToPDF([\r\n      img1,\r\n      { src: img2, options: { height: 234, width: 345 } },\r\n    ])\r\n\r\n    const dataUrl = pdf.dataUrl()\r\n    const arrayBuffer = pdf.arrayBuffer()\r\n  }\r\n\r\n  main()\r\n  ```\r\n\r\n- Using `ImagesToPDF` class.\r\n\r\n  ```js\r\n  import ImagesToPDF from '@coderosh/images-to-pdf'\r\n\r\n  const main = async () => {\r\n    const img1 = await fetch('https://img1').then((res) => res.arrayBuffer())\r\n    const img2 = await fetch('https://img2').then((res) => res.arrayBuffer())\r\n    const img3 = await fetch('https://img3').then((res) => res.arrayBuffer())\r\n    const img4 = await fetch('https://img4').then((res) => res.arrayBuffer())\r\n\r\n    const imgToPdf = new ImagesToPDF([img1, { src: img2 }])\r\n    imgToPdf.addImage(img3)\r\n    imgToPdf.addImage(img4, { height: 234, width: 324 })\r\n\r\n    const pdf = await imgToPdf.createPdf()\r\n\r\n    const dataUrl = pdf.dataUrl()\r\n    const arrayBuffer = pdf.arrayBuffer()\r\n  }\r\n\r\n  main()\r\n  ```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","keywords":["pdf","images-to-pdf","pdf-converter","pdf-from-images"]}