Skip to content

Commit 3daa829

Browse files
committed
fix build for release
1 parent a81ba36 commit 3daa829

File tree

10 files changed

+38714
-45844
lines changed

10 files changed

+38714
-45844
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ There are two different injectables props you can pass to the web reader.
123123

124124
Your app can provide both props or only one. The reader will decide which one to load into the iframe based on the book format defined in the webpub manifest.
125125

126+
## Required CSS for the PDF Reader (Text & Annotation Layers)
127+
128+
When rendering PDFs the library relies on `react-pdf`'s text and annotation layer styles.
129+
130+
To avoid importing global CSS from inside distributed JS in Next.js applications, you must import global CSS only from the app root (`pages/_app.js` / `pages/_app.tsx` or `app/layout.tsx`). After installing `@nypl/web-reader`, import the following CSS from your application root:
131+
132+
```js
133+
// pages/_app.tsx or app/layout.tsx
134+
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
135+
import 'react-pdf/dist/esm/Page/TextLayer.css';
136+
```
137+
126138
## Other Injectables
127139

128140
You can import and inject other files into the `<WebReader />` to customize behavior. For example, in Open eBooks, we import some [custom JavaScript](https://github.com/NYPL/ereading-clients/blob/staging/apps/oew/src/components/theme-ui/WebReader.tsx#L65) to disable right clicking & copying copywritten content.

example/static/pdf-worker/pdf.min.mjs

Lines changed: 1 addition & 8 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)