Skip to content

Commit

Permalink
Add module format-agnostic exports
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Jul 27, 2023
1 parent c7414fe commit 5bbf9f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ Check the [sample directory](https://github.com/wojtekmaj/react-pdf/tree/main/sa
If you want to use annotations (e.g. links) in PDFs rendered by React-PDF, then you would need to include stylesheet necessary for annotations to be correctly displayed like so:

```ts
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
import 'react-pdf/dist/Page/AnnotationLayer.css';
```

### Support for text layer

If you want to use text layer in PDFs rendered by React-PDF, then you would need to include stylesheet necessary for text layer to be correctly displayed like so:

```ts
import 'react-pdf/dist/esm/Page/TextLayer.css';
import 'react-pdf/dist/Page/TextLayer.css';
```

### Support for non-latin characters
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./dist/Page/AnnotationLayer.css": {
"import": "./dist/esm/Page/AnnotationLayer.css",
"require": "./dist/cjs/Page/AnnotationLayer.css"
},
"./dist/Page/TextLayer.css": {
"import": "./dist/esm/Page/TextLayer.css",
"require": "./dist/cjs/Page/TextLayer.css"
},
"./dist/cjs/Page/AnnotationLayer.css": "./dist/cjs/Page/AnnotationLayer.css",
"./dist/cjs/Page/TextLayer.css": "./dist/cjs/Page/TextLayer.css",
"./dist/esm/Page/AnnotationLayer.css": "./dist/esm/Page/AnnotationLayer.css",
Expand Down

0 comments on commit 5bbf9f7

Please sign in to comment.