{"_id":"@angelcat/rn-pdf-thumbnail","_rev":"4-0f5faec25119a6bf5c6f322c96c68705","name":"@angelcat/rn-pdf-thumbnail","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@angelcat/rn-pdf-thumbnail","version":"1.0.0","keywords":["react-native","pdf","thumbnail","ios","android"],"author":{"name":"nntu"},"license":"MIT","_id":"@angelcat/rn-pdf-thumbnail@1.0.0","maintainers":[{"name":"angelcat","email":"npp.nguyentuan@gmail.com"}],"homepage":"https://github.com/nntu/rn-pdf-thumbnail#readme","bugs":{"url":"https://github.com/nntu/rn-pdf-thumbnail/issues"},"dist":{"shasum":"50fc1cb1ff0618a4464af8e806b46f247a2af85a","tarball":"https://registry.npmjs.org/@angelcat/rn-pdf-thumbnail/-/rn-pdf-thumbnail-1.0.0.tgz","fileCount":22,"integrity":"sha512-5OOOvac5kuctnEU/jBsNVj+JBG/CJsE0Vs5aDV205T2huX/zYs6mq2GWDamtw4pxDyn9oODjt4xEkGXMYubQ6w==","signatures":[{"sig":"MEQCIGCLWJyUz5+AxI7T6mPJTSwEJL8ak8SOaUfl8mpCK8Z/AiA0yW4x+wRKjgmXuNTxs++TZ98Ka2sovQzV/CBf98UdTg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27853},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/src/index.d.ts","module":"lib/module/index","source":"src/index","engines":{"node":">= 18.0.0"},"gitHead":"c95152e8ba6db39228f0e3f600ab5eb840272b0e","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-pdf-thumbnail-example","prepare":"bob build","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"angelcat","email":"npp.nguyentuan@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/nntu/rn-pdf-thumbnail.git","type":"git"},"workspaces":["example"],"_npmVersion":"10.9.2","description":"Generate thumbnail for PDF files","directories":{},"resolutions":{"@types/react":"17.0.21"},"_nodeVersion":"23.9.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}]},"extends":["@react-native","prettier"]},"eslintIgnore":["node_modules/","lib/"],"react-native":"src/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"jest":"^28.1.1","react":"18.2.0","turbo":"^1.10.7","eslint":"^8.4.1","del-cli":"^5.0.0","prettier":"^2.0.5","commitlint":"^17.0.2","release-it":"^15.0.0","typescript":"^5.0.2","@types/jest":"^28.1.2","pod-install":"^0.1.0","@types/react":"~17.0.21","react-native":"0.72.6","@types/react-native":"0.70.0","@evilmartians/lefthook":"^1.5.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","react-native-builder-bob":"^0.37.0","@react-native/eslint-config":"^0.72.2","@commitlint/config-conventional":"^17.0.2","@release-it/conventional-changelog":"^5.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/rn-pdf-thumbnail_1.0.0_1741955766518_0.7133616066679349","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"1.0.1":{"name":"@angelcat/rn-pdf-thumbnail","version":"1.0.1","keywords":["react-native","pdf","thumbnail","ios","android"],"author":{"name":"nntu"},"license":"MIT","_id":"@angelcat/rn-pdf-thumbnail@1.0.1","maintainers":[{"name":"angelcat","email":"npp.nguyentuan@gmail.com"}],"homepage":"https://github.com/nntu/rn-pdf-thumbnail#readme","bugs":{"url":"https://github.com/nntu/rn-pdf-thumbnail/issues"},"dist":{"shasum":"82a957b0aad29d24c59f78b642fed3a590405dd1","tarball":"https://registry.npmjs.org/@angelcat/rn-pdf-thumbnail/-/rn-pdf-thumbnail-1.0.1.tgz","fileCount":22,"integrity":"sha512-1QlOl3TXa/L4vuHWwtxSwAUFePsoxVVBpgsQJiT98Cnc7/a7ZjhYmL4NzB3mVM0oMHyyLXIPfYY5KYd6Nbv5jQ==","signatures":[{"sig":"MEUCIQDOK/QelvXePGC9uVWGq7Smz3SDQ/ltk6riMkeXftGd2wIgAY1Dj8Bo3kweDIn+MBN3OL8Frdz8+IZGUclYSbC2flY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27968},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/src/index.d.ts","module":"lib/module/index","source":"src/index","engines":{"node":">= 18.0.0"},"gitHead":"c95152e8ba6db39228f0e3f600ab5eb840272b0e","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-pdf-thumbnail-example","prepare":"bob build","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"angelcat","email":"npp.nguyentuan@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/nntu/rn-pdf-thumbnail.git","type":"git"},"workspaces":["example"],"_npmVersion":"10.9.2","description":"Generate thumbnail for PDF files","directories":{},"resolutions":{"@types/react":"17.0.21"},"_nodeVersion":"23.9.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}]},"extends":["@react-native","prettier"]},"eslintIgnore":["node_modules/","lib/"],"react-native":"src/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"jest":"^28.1.1","react":"18.2.0","turbo":"^1.10.7","eslint":"^8.4.1","del-cli":"^5.0.0","prettier":"^2.0.5","commitlint":"^17.0.2","release-it":"^15.0.0","typescript":"^5.0.2","@types/jest":"^28.1.2","pod-install":"^0.1.0","@types/react":"~17.0.21","react-native":"0.72.6","@types/react-native":"0.70.0","@evilmartians/lefthook":"^1.5.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","react-native-builder-bob":"^0.37.0","@react-native/eslint-config":"^0.72.2","@commitlint/config-conventional":"^17.0.2","@release-it/conventional-changelog":"^5.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/rn-pdf-thumbnail_1.0.1_1741956014033_0.2717180526165226","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"1.0.2":{"name":"@angelcat/rn-pdf-thumbnail","version":"1.0.2","keywords":["react-native","pdf","thumbnail","ios","android"],"author":{"name":"nntu"},"license":"MIT","_id":"@angelcat/rn-pdf-thumbnail@1.0.2","maintainers":[{"name":"angelcat","email":"npp.nguyentuan@gmail.com"}],"homepage":"https://github.com/nntu/rn-pdf-thumbnail#readme","bugs":{"url":"https://github.com/nntu/rn-pdf-thumbnail/issues"},"dist":{"shasum":"2360d76d621c182336aec42f41d75e6aa938b35b","tarball":"https://registry.npmjs.org/@angelcat/rn-pdf-thumbnail/-/rn-pdf-thumbnail-1.0.2.tgz","fileCount":22,"integrity":"sha512-EIIRw925CAmr4ZDer1YUF/3k0dKTv2Zz/1yBqtR8p7cL9dTUOsSi9GMKW3kHP2kvj3UHNfJQ7mYGjsdUrkhJNw==","signatures":[{"sig":"MEYCIQCfppLXjm911/f7JQbl/CxaJ5OvSFa+tQW74mPIgIB0+QIhAM57RFmP1hyt8FgMsI+c08wTyaqVZ+If+i1jcwbUaUsp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27965},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/src/index.d.ts","module":"lib/module/index","source":"src/index","engines":{"node":">= 18.0.0"},"gitHead":"44766ae8842f3e8a872e8bd7b2230b2e70406adb","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-pdf-thumbnail-example","prepare":"bob build","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"angelcat","email":"npp.nguyentuan@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/nntu/rn-pdf-thumbnail.git","type":"git"},"workspaces":["example"],"_npmVersion":"10.9.2","description":"Generate thumbnail for PDF files","directories":{},"resolutions":{"@types/react":"17.0.21"},"_nodeVersion":"23.9.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}]},"extends":["@react-native","prettier"]},"eslintIgnore":["node_modules/","lib/"],"react-native":"src/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"jest":"^28.1.1","react":"18.2.0","turbo":"^1.10.7","eslint":"^8.4.1","del-cli":"^5.0.0","prettier":"^2.0.5","commitlint":"^17.0.2","release-it":"^15.0.0","typescript":"^5.0.2","@types/jest":"^28.1.2","pod-install":"^0.1.0","@types/react":"~17.0.21","react-native":"0.72.6","@types/react-native":"0.70.0","@evilmartians/lefthook":"^1.5.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","react-native-builder-bob":"^0.37.0","@react-native/eslint-config":"^0.72.2","@commitlint/config-conventional":"^17.0.2","@release-it/conventional-changelog":"^5.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/rn-pdf-thumbnail_1.0.2_1742002833452_0.045198790786958876","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"1.0.3":{"name":"@angelcat/rn-pdf-thumbnail","version":"1.0.3","description":"Generate thumbnail for PDF files","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"example":"yarn workspace react-native-pdf-thumbnail-example","test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","pdf","thumbnail","ios","android"],"repository":{"type":"git","url":"git+https://github.com/nntu/rn-pdf-thumbnail.git"},"author":{"name":"nntu"},"license":"MIT","bugs":{"url":"https://github.com/nntu/rn-pdf-thumbnail/issues"},"homepage":"https://github.com/nntu/rn-pdf-thumbnail#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.5.0","@react-native/eslint-config":"^0.72.2","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^8.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jest":"^28.1.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"18.2.0","react-native":"0.72.6","react-native-builder-bob":"^0.37.0","release-it":"^15.0.0","turbo":"^1.10.7","typescript":"^5.0.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","engines":{"node":">= 18.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"_id":"@angelcat/rn-pdf-thumbnail@1.0.3","gitHead":"44766ae8842f3e8a872e8bd7b2230b2e70406adb","_nodeVersion":"23.9.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-w5MDsA8pFiYbHrkJ28l7KxZC5w6lXIk0to5Ei5flsgn23GmLOsCn5/8lJ5ZU5c3gDWk8aAhhDYStGBlTS/SiBA==","shasum":"4e41e54bb498026e7bae1850772bd89142893cd4","tarball":"https://registry.npmjs.org/@angelcat/rn-pdf-thumbnail/-/rn-pdf-thumbnail-1.0.3.tgz","fileCount":22,"unpackedSize":29523,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDDfdA+2kNlXlZiq8MvSjsg67xNGaR9QR6H7DTW0cONGAiABNfWVJj2Ee7yD6w+G4EnOgJ/u+QTV+tr44GQzWGivDA=="}]},"_npmUser":{"name":"angelcat","email":"npp.nguyentuan@gmail.com"},"directories":{},"maintainers":[{"name":"angelcat","email":"npp.nguyentuan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rn-pdf-thumbnail_1.0.3_1742004775672_0.4652018171890351"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-14T12:36:06.417Z","modified":"2025-03-15T02:12:56.093Z","1.0.0":"2025-03-14T12:36:06.737Z","1.0.1":"2025-03-14T12:40:14.217Z","1.0.2":"2025-03-15T01:40:33.680Z","1.0.3":"2025-03-15T02:12:55.916Z"},"bugs":{"url":"https://github.com/nntu/rn-pdf-thumbnail/issues"},"author":{"name":"nntu"},"license":"MIT","homepage":"https://github.com/nntu/rn-pdf-thumbnail#readme","keywords":["react-native","pdf","thumbnail","ios","android"],"repository":{"type":"git","url":"git+https://github.com/nntu/rn-pdf-thumbnail.git"},"description":"Generate thumbnail for PDF files","maintainers":[{"name":"angelcat","email":"npp.nguyentuan@gmail.com"}],"readme":"# @angelcat/rn-pdf-thumbnail\n\nThis library is forked from [react-native-pdf-thumbnail](https://github.com/Ky0-Nguyen/rn-pdf-thumbnail).\n\nA react native module for generating thumbnail for PDF files.\n\n> **Important Note**: This library does not work directly with Expo or Mini Apps due to its native dependencies. A special setup is required for Mini Apps, and the library must be installed in the Host App for native functionality.\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\n## Installation\n\n### Host App Installation\n\n```sh\nnpm install @angelcat/rn-pdf-thumbnail\n# or\nyarn add @angelcat/rn-pdf-thumbnail\n```\n\nAfter installing the package, you need to link the native modules. If you're using React Native 0.60+, linking is automatic. For iOS, you'll need to install pods:\n\n```sh\ncd ios && pod install\n```\n\n### Additional Setup for Mini App React Native\n\nSince this library contains native code that can't be bundled directly in a Mini App, you'll need to:\n\n1. Install the library in your Host App first (see Host App Installation above)\n2. Configure your Mini App's webpack to properly handle the library:\n\n```js\nrules: [\n  {\n    test: /\\.[cm]?[jt]sx?$/,\n    include: [\n      // ... other includes ...\n      /node_modules(.*[/\\\\])+@angelcat[/\\\\]rn-pdf-thumbnail/\n    ],\n    use: 'babel-loader',\n  }\n]\n```\n\nAlso, add the following to your ModuleFederationPlugin configuration:\n\n```js\nnew ModuleFederationPlugin({\n  // ... other configurations ...\n  shared: {\n    ...getSharedDependencies({\n      eager: STANDALONE,\n      isImport: STANDALONE ? undefined : false,\n    }),\n    '@angelcat/rn-pdf-thumbnail': {\n      eager: STANDALONE,\n      singleton: true,\n      requiredVersion: '*',\n      import: undefined,\n    },\n  }\n})\n```\n\nThis setup ensures that:\n1. The Mini App can use the library's JavaScript interface\n2. The actual native functionality is provided by the Host App's installation\n3. There won't be any conflicts between different versions of the library\n\n## Usage\n\n```js\nimport PdfThumbnail from \"@angelcat/rn-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","readmeFilename":"README.md"}