{"id":19355633,"url":"https://github.com/songsterq/react-native-pdf-thumbnail","last_synced_at":"2025-05-07T01:49:56.239Z","repository":{"id":37910824,"uuid":"277460756","full_name":"songsterq/react-native-pdf-thumbnail","owner":"songsterq","description":"react native module for generating thumbnail for PDF files","archived":false,"fork":false,"pushed_at":"2024-04-11T12:47:24.000Z","size":2971,"stargazers_count":45,"open_issues_count":11,"forks_count":22,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T19:08:36.987Z","etag":null,"topics":["pdf","react-native"],"latest_commit_sha":null,"homepage":"","language":"Java","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/songsterq.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":"2020-07-06T06:29:37.000Z","updated_at":"2024-09-16T15:17:19.000Z","dependencies_parsed_at":"2023-02-17T16:30:39.117Z","dependency_job_id":"3ed57aa4-cd94-4c8c-80eb-ad28359c17dc","html_url":"https://github.com/songsterq/react-native-pdf-thumbnail","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":"0.43243243243243246","last_synced_commit":"386654db353f4242ed03248548f4919cad39f8c6"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songsterq%2Freact-native-pdf-thumbnail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songsterq%2Freact-native-pdf-thumbnail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songsterq%2Freact-native-pdf-thumbnail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songsterq%2Freact-native-pdf-thumbnail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/songsterq","download_url":"https://codeload.github.com/songsterq/react-native-pdf-thumbnail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798781,"owners_count":21805880,"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":["pdf","react-native"],"created_at":"2024-11-10T06:03:06.849Z","updated_at":"2025-05-07T01:49:56.195Z","avatar_url":"https://github.com/songsterq.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-pdf-thumbnail\n\nA react native module for generating thumbnail for PDF files.\n\nA wrapper for:\n- PDFKit on iOS (requires iOS 11+)\n- PdfRenderer on Android (requires API level 21 - LOLLIPOP)\n\nNo other JavaScript or native dependencies.\n\nNote: This module **does not** work in Expo.\n\n## Installation\n\n```sh\nnpm install react-native-pdf-thumbnail\n```\n\n## Usage\n\n```js\nimport PdfThumbnail from \"react-native-pdf-thumbnail\";\n\n// For iOS, the filePath can be a file URL.\n// For Android, the filePath can be either a content URI, a file URI or an absolute path.\nconst filePath = 'file:///mnt/sdcard/myDocument.pdf';\nconst page = 0;\n\n// The thumbnail image is stored in caches directory, file uri is returned.\n// Image dimensions are also available to help you display it correctly.\nconst { uri, width, height } = await PdfThumbnail.generate(filePath, page);\n\n// Generate thumbnails for all pages, returning an array of the object above.\nconst results = await PdfThumbnail.generateAllPages(filePath);\n\n// Default compression quality is 80, you can optionally specify a quality between 0 and 100.\nconst { uri, width, height } = await PdfThumbnail.generate(filePath, page, 95);\nconst results = await PdfThumbnail.generateAllPages(filePath, 90);\n```\n\n## Demo\n\nThe example app contains a document picker, it generates and displays a thumbnail for the selected PDF file.\n\nTo run it:\n```sh\nyarn\nyarn example ios\nyarn example android\n```\n\niOS | Android\n------- | ---\n![86563759-d103db80-bf19-11ea-98a2-77788efe4938](https://user-images.githubusercontent.com/3325682/86644851-bfaae580-bf92-11ea-8b2b-f065784b3425.png) | ![86564313-dca3d200-bf1a-11ea-99fe-6f08a3302b20](https://user-images.githubusercontent.com/3325682/86644858-c174a900-bf92-11ea-8a01-79476b1050a1.png)\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\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongsterq%2Freact-native-pdf-thumbnail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsongsterq%2Freact-native-pdf-thumbnail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongsterq%2Freact-native-pdf-thumbnail/lists"}