npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@coolsoftwaretyler/cool-pdf

v0.1.10

Published

PDF View Component for Expo

Downloads

1,154

Readme

cool-pdf

PDF View Component for Expo. Intended as a drop-in replacement for react-native-pdf. Check compatibility table for current progress. Contributions welcome.

Roadmap

See this GitHub issue explaining the motivation and intentions for the project

Installation

Add the package to your dependencies

npm install @coolsoftwaretyler/cool-pdf

Run a fresh prebuild

npx expo prebuild --clean

Run your app

Start up Android or iOS

Usage

import { CoolPdfView } from "@coolsoftwaretyler/cool-pdf";

<CoolPdfView source={{ uri: url }} />;

Compatibility with react-native-pdf

Overall compatibility: 89%

  • 27/29 props
  • 6/6 source parameters
  • 6/9 types of source uri
  • 39/44 total props supported

Props

| Property | Type | Default | Description | iOS | Android | Supported | | ------------------------------ | :-----------------------------------------------------------: | :----------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------- | --------- | | source | object | not null | PDF source like {uri:xxx, cache:false}. see the following for detail. | ✔ | ✔ | ✔ | | page | number | 1 | initial page index | ✔ | ✔ | ✔ | | scale | number | 1.0 | should minScale<=scale<=maxScale | ✔ | ✔ | ✔ | | minScale | number | 1.0 | min scale | ✔ | ✔ | ✔ | | maxScale | number | 3.0 | max scale | ✔ | ✔ | ✔ | | horizontal | bool | false | draw page direction, if you want to listen the orientation change, you can use react-native-orientation-locker | ✔ | ✔ | ✔ | | showsHorizontalScrollIndicator | bool | true | shows or hides the horizontal scroll bar indicator on iOS | ✔ | | ✔ | | showsVerticalScrollIndicator | bool | true | shows or hides the vertical scroll bar indicator on iOS | ✔ | | ✔ | | scrollEnabled | bool | true | enable or disable scroll | ✔ | | ✔ | | fitPolicy | number | 2 | 0:fit width, 1:fit height, 2:fit both(default) | ✔ | ✔ | ✔ | | spacing | number | 10 | the breaker size between pages | ✔ | ✔ | ✔ | | password | string | "" | pdf password, if password error, will call OnError() with message "Password required or incorrect password." | ✔ | ✔ | ✔ | | style | object | {backgroundColor:"#eee"} | support normal view style, you can use this to set border/spacing color... | ✔ | ✔ | ✔ | | progressContainerStyle | object | {backgroundColor:"#eee"} | support normal view style, you can use this to set border/spacing color... | ✔ | ✔ | ✔ | | renderActivityIndicator | (progress) => Component | | when loading show it as an indicator, you can use your component | ✔ | ✔ | ✔ | | enableAntialiasing | bool | true | improve rendering a little bit on low-res screens, but maybe course some problem on Android 4.4, so add a switch | ✖ | ✔ | ✖ | | enablePaging | bool | false | only show one page in screen | ✔ | ✔ | ✔ | | enableRTL | bool | false | scroll page as "page3, page2, page1" | ✔ | ✖ | ✔ | | enableAnnotationRendering | bool | true | enable rendering annotation, notice:iOS only support initial setting,not support realtime changing | ✔ | ✔ | ✔ | | enableDoubleTapZoom | bool | true | Enable double tap to zoom gesture | ✔ | ✔ | ✔ | | trustAllCerts | bool | true | Allow connections to servers with self-signed certification | ✔ | ✔ | ✖ | | singlePage | bool | false | Only show first page, useful for thumbnail views | ✔ | ✔ | ✔ | | onLoadProgress | function(percent) | null | callback when loading, return loading progress (0-1) | ✔ | ✔ | ✔ | | onLoadComplete | function(numberOfPages, path, {width, height}, tableContents) | null | callback when pdf load completed, return total page count, pdf local/cache path, {width,height} and table of contents | ✔ | ✔ | ✔ | | onPageChanged | function(page,numberOfPages) | null | callback when page changed ,return current page and total page count | ✔ | ✔ | ✔ | | onError | function(error) | null | callback when error happened | ✔ | ✔ | ✔ | | onPageSingleTap | function(page) | null | callback when page was single tapped | ✔ | ✔ | ✔ | | onScaleChanged | function(scale) | null | callback when scale page | ✔ | ✔ | ✔ | | onPressLink | function(uri) | null | callback when link tapped | ✔ | ✔ | ✔ |

parameters of source

| parameter | Description | default | iOS | Android | Supported | | ------------- | --------------------------------------------- | ---------------- | --- | ------- | --------- | | uri | pdf source, see the following for detail. | required | ✔ | ✔ | ✔ | | cache | use cache or not | false | ✔ | ✔ | ✔ | | cacheFileName | specific file name for cached pdf file | SHA1(uri) result | ✔ | ✔ | ✔ | | expiration | cache file expired seconds (0 is not expired) | 0 | ✔ | ✔ | ✔ | | method | request method when uri is a url | "GET" | ✔ | ✔ | ✔ | | headers | request headers when uri is a url | {} | ✔ | ✔ | ✔ |

types of source.uri

| Usage | Description | iOS | Android | Supported | | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ---- | ------- | --------- | | {uri:"http://xxx/xxx.pdf"} | load pdf from a url | ✔ | ✔ | ✔ | | {require("./test.pdf")} | load pdf relate to js file (do not need add by xcode) | ✔ | ✔ | ✔ | | {uri:"bundle-assets://path/to/xxx.pdf"} | load pdf from assets, the file should be at android/app/src/main/assets/path/to/xxx.pdf | ✖ | ✔ | ✔ | | {uri:"bundle-assets://xxx.pdf"} | load pdf from assets, you must add pdf to project by xcode. this does not support folder. | ✔ | ✖ | ✔ | | {uri:"data:application/pdf;base64,JVBERi0xLjcKJc..."} | load pdf from base64 string | ✔ | ✔ | ✔ | | {uri:"file:///absolute/path/to/xxx.pdf"} | load pdf from local file system | ✔ | ✔ | ✔ | | {uri:"ms-appx:///xxx.pdf"}} | load pdf bundled with UWP app | ✖ | ✖ | ✖ | | {uri:"content://com.example.blobs/xxxxxxxx-...?offset=0&size=xxx"} | load pdf from content URI | ✔* | ✖ | ✖ | | {uri:"blob:xxxxxxxx-...?offset=0&size=xxx"} | load pdf from blob URL | ✖ | ✔ | ✖ |