{"id":24836799,"url":"https://github.com/benjamineruvieru/react-native-pdf-from-image","last_synced_at":"2025-10-14T11:31:39.617Z","repository":{"id":274811139,"uuid":"924158561","full_name":"benjamineruvieru/react-native-pdf-from-image","owner":"benjamineruvieru","description":"Generate PDF documents from an array of images.","archived":false,"fork":false,"pushed_at":"2025-06-04T12:39:06.000Z","size":3269,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-12T23:47:16.365Z","etag":null,"topics":["image-to-pdf","pdf-generation","pdf-generation-react","react-native"],"latest_commit_sha":null,"homepage":"https://docs.benjamineruvieru.com/docs/react-native-pdf-from-image/","language":"Kotlin","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/benjamineruvieru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2025-01-29T14:19:04.000Z","updated_at":"2025-09-04T09:29:22.000Z","dependencies_parsed_at":"2025-01-29T15:04:33.916Z","dependency_job_id":"6272ec68-070c-4030-a42a-5e3509408e36","html_url":"https://github.com/benjamineruvieru/react-native-pdf-from-image","commit_stats":null,"previous_names":["benjamineruvieru/react-native-pdf-from-image"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/benjamineruvieru/react-native-pdf-from-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamineruvieru%2Freact-native-pdf-from-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamineruvieru%2Freact-native-pdf-from-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamineruvieru%2Freact-native-pdf-from-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamineruvieru%2Freact-native-pdf-from-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjamineruvieru","download_url":"https://codeload.github.com/benjamineruvieru/react-native-pdf-from-image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamineruvieru%2Freact-native-pdf-from-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019089,"owners_count":26086516,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","pdf-generation","pdf-generation-react","react-native"],"created_at":"2025-01-31T05:43:50.746Z","updated_at":"2025-10-14T11:31:39.610Z","avatar_url":"https://github.com/benjamineruvieru.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg width=\"200\" height=\"200\" src=\"./IMG/logo.png\"/\u003e\u003cbr/\u003e\n  React Native Pdf From Image Library\n\u003c/h1\u003e\n\nGenerate PDF documents from an array of images.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-pdf-from-image\"\u003e\n    \u003cimg alt=\"npm version\" src=\"https://badge.fury.io/js/react-native-pdf-from-image.svg\"/\u003e\n  \u003c/a\u003e\n  \u003ca title='License' href=\"https://github.com/benjamineruvieru/react-native-pdf-from-image/blob/master/LICENSE\" height=\"18\"\u003e\n    \u003cimg src='https://img.shields.io/badge/license-MIT-blue.svg' /\u003e\n  \u003c/a\u003e\n  \u003ca title='Tweet' href=\"https://twitter.com/intent/tweet?text=Check%20out%20this%20awesome%20React%20Native%20PDF%20from%20Image%20Library\u0026url=https://github.com/benjamineruvieru/react-native-pdf-from-image\u0026via=benjamin_eru\u0026hashtags=react,reactnative,opensource,github,ux\" height=\"18\"\u003e\n    \u003cimg src='https://img.shields.io/twitter/url/http/shields.io.svg?style=social' /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 🌟 Features\n\n- **Image to PDF Conversion**: Effortlessly convert images into PDF documents.\n- **Customizable Paper Sizes**: Choose from standard paper sizes or define custom dimensions for your PDFs.\n\n## Old Architecture Support\n\n~~react-native-pdf-from-image is a pure TurboModule, and **requires the new architecture to be enabled**.~~\n~~- Work is ongoing to support the old architecture.~~\n\nThe library now supports both new and old architecture! 🎉🎉🎉\n\n## 🚀 Installation\n\n```sh\nnpm install react-native-pdf-from-image\n```\n\nor\n\n```sh\nyarn add react-native-pdf-from-image\n```\n\n```sh\ncd ios \u0026\u0026 pod install\n```\n\n## 📖 Usage\n\nHere's a basic example of how to use the library:\n\n```js\nimport { createPdf } from 'react-native-pdf-from-image';\n\nconst images = ['path/to/image1.jpg'];\n\nconst { filePath } = createPdf({\n  imagePaths: images,\n  name: 'myPdf',\n  paperSize: 'A4', // optional\n  // optional\n  customPaperSize: {\n    height: 300,\n    width: 300,\n  },\n});\n```\n\n\u003e **Note:** When using the old architecture, make sure to await the `createPdf` function as it returns a Promise.\n\n```js\nimport { createPdf } from 'react-native-pdf-from-image';\n\n// Old Architecture\nconst generatePdf = async () =\u003e {\n  const images = ['path/to/image1.jpg'];\n  const { filePath } = await createPdf({\n    imagePaths: images,\n    name: 'myPdf',\n    paperSize: 'A4', // optional\n    // optional\n    customPaperSize: {\n      height: 300,\n      width: 300,\n    },\n  });\n};\n```\n\n## 📦 Props\n\n### createPdf(params)\n\n- params : An object containing the following properties:\n  - imagePaths (Array of strings): An array of file paths to the images you want to include in the PDF.\n  - name (string): The name of the PDF file to be created.\n  - paperSize (string, optional): The size of the paper for the PDF. Common sizes like 'A4' are supported.\n  - customPaperSize (object, optional): An object specifying custom dimensions for the paper size. It should have height and width properties.\n\n### Returns\n\n- An object containing:\n  - filePath (string): The file path to the generated PDF document.\n\n\u003e **Note:** If neither paperSize or customPaperSize is passed then the image dimensions would be used as the paper size of the pdf.\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamineruvieru%2Freact-native-pdf-from-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjamineruvieru%2Freact-native-pdf-from-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamineruvieru%2Freact-native-pdf-from-image/lists"}