1. react-pdf-handler
React pdf handler allows to render a PDF and handle text selection and highlights.
react-pdf-handler
Package: react-pdf-handler
Last modified: Tue, 16 Apr 2024 16:02:05 GMT
Version: 1.0.1
License: Apache-2.0
Downloads: 7

Install

npm install react-pdf-handler
yarn add react-pdf-handler

How to use

Clone this repo to your local computer, then run:

  • yarn install & yarn build

  • To make this component available to other projects on your local computer, run yarn link.

  • Then go to the project where you want to use this package and run yarn link "react-pdf-handler".

Finally, to fix the multiple copies of React bug that shows up with linked React packages:

  • navigate to the root of the react-pdf-handler package
  • run npm link "../path/to/your/project/node_modules/react"
  • run npm link "../path/to/your/project/node_modules/react-dom"

You can now import PdfHandler as a normal package installed from npm like so:

import PdfHandler from 'PdfHandler'
...

You can also import the type definitions if you're using TypeScript like so:

import PdfHandler, { IPdfHandlerProps } from 'PdfHandler'
...

Compiling with babel

yarn babel -D -d dist/ src/* --extensions ".ts,.tsx"

Using module in other project

yarn add file:PATH/react-pdf-handler

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code