{"id":21327014,"url":"https://github.com/coderosh/images-to-pdf","last_synced_at":"2025-06-15T05:34:13.280Z","repository":{"id":57103148,"uuid":"422247883","full_name":"coderosh/images-to-pdf","owner":"coderosh","description":"Combine images to a single pdf. (browser and node)","archived":false,"fork":false,"pushed_at":"2021-11-16T15:14:46.000Z","size":90,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T09:49:07.609Z","etag":null,"topics":["image-to-pdf","image-to-pdf-converter","pdf","pdf-from-image"],"latest_commit_sha":null,"homepage":"https://coderosh.github.io/images-to-pdf","language":"TypeScript","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/coderosh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-28T15:00:22.000Z","updated_at":"2024-02-15T18:48:05.000Z","dependencies_parsed_at":"2022-08-21T00:30:10.310Z","dependency_job_id":null,"html_url":"https://github.com/coderosh/images-to-pdf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/coderosh/images-to-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderosh%2Fimages-to-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderosh%2Fimages-to-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderosh%2Fimages-to-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderosh%2Fimages-to-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderosh","download_url":"https://codeload.github.com/coderosh/images-to-pdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderosh%2Fimages-to-pdf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259926967,"owners_count":22933134,"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-to-pdf","image-to-pdf-converter","pdf","pdf-from-image"],"created_at":"2024-11-21T21:12:50.766Z","updated_at":"2025-06-15T05:34:13.257Z","avatar_url":"https://github.com/coderosh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# images-to-pdf\n\n\u003e Combine images to a single pdf. Works on both browser and node.\n\n\u003ca href=\"https://npmjs.com/package/@coderosh/images-to-pdf\"\u003e\u003cimg alt=\"NPM\" src=\"https://img.shields.io/npm/v/@coderosh/images-to-pdf\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/coderosh/images-to-pdf\"\u003e\u003cimg alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg alt=\"CI\" src=\"https://img.shields.io/github/workflow/status/coderosh/images-to-pdf/CI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/coderosh/images-to-pdf\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome!\" /\u003e\u003c/a\u003e\n\n## Installation\n\n```sh\n# node\nnpm install @coderosh/images-to-pdf\n\n# yarn\nyarn add @coderosh/images-to-pdf\n```\n\n## Usage\n\nThis package requires image to be of type arraybuffer or uint8array.\n\n- Using `imagesToPDF` function.\n\n  ```js\n  import { imagesToPDF } from '@coderosh/images-to-pdf'\n\n  const main = async () =\u003e {\n    const img1 = await fetch('https://img1').then((res) =\u003e res.arrayBuffer())\n    const img2 = await fetch('https://img2').then((res) =\u003e res.arrayBuffer())\n\n    const pdf = await imagesToPDF([\n      img1,\n      { src: img2, options: { height: 234, width: 345 } },\n    ])\n\n    const dataUrl = pdf.dataUrl()\n    const arrayBuffer = pdf.arrayBuffer()\n  }\n\n  main()\n  ```\n\n- Using `ImagesToPDF` class.\n\n  ```js\n  import ImagesToPDF from '@coderosh/images-to-pdf'\n\n  const main = async () =\u003e {\n    const img1 = await fetch('https://img1').then((res) =\u003e res.arrayBuffer())\n    const img2 = await fetch('https://img2').then((res) =\u003e res.arrayBuffer())\n    const img3 = await fetch('https://img3').then((res) =\u003e res.arrayBuffer())\n    const img4 = await fetch('https://img4').then((res) =\u003e res.arrayBuffer())\n\n    const imgToPdf = new ImagesToPDF([img1, { src: img2 }])\n    imgToPdf.addImage(img3)\n    imgToPdf.addImage(img4, { height: 234, width: 324 })\n\n    const pdf = await imgToPdf.createPdf()\n\n    const dataUrl = pdf.dataUrl()\n    const arrayBuffer = pdf.arrayBuffer()\n  }\n\n  main()\n  ```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderosh%2Fimages-to-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderosh%2Fimages-to-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderosh%2Fimages-to-pdf/lists"}