You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`initialized` - Fired after the PDF.js viewer is ready (after `PDFViewerApplication.initializedPromise` resolves). The event `detail` contains:
194
-
195
-
-`viewerApp` (`PDFViewerApplication`)
196
-
-`viewerOptions` (`PDFViewerApplicationOptions`)
197
-
198
-
The event is emitted each time the internal viewer is rebuilt (for example after changing `locale`).
199
-
200
-
## Migration notes
182
+
Public properties:
201
183
202
-
If you are upgrading from an older version:
184
+
`initPromise: Promise<InitializationData>` - Resolves after internal viewer is completely loaded and initialized, returning `{ viewerApp }`, that gives a programmatic access to PDF.js viewer app (PDFViewerApplication).
203
185
204
-
-`viewer-extra-styles` and `viewer-extra-styles-urls` attributes are removed.
205
-
- Use `injectViewerStyles(styles)` instead of style attributes.
206
-
- Use the `initialized` event for `viewerApp` / `viewerOptions` access.
207
-
- Runtime `src` updates are supported with `setAttribute('src', ...)`.
Use `iframe-title` to add a title to the `iframe` element and improve accessibility.
192
+
viewerApp.open({ url:'/sample.pdf' })
193
+
```
212
194
213
-
## Known issues
195
+
`iframe: PdfjsViewerElementIframe` - Public reference to the internal `iframe` element. Useful when you need direct access to `contentWindow`/`contentDocument`.
214
196
215
-
### The `.mjs` files support
197
+
Example (`iframe`):
216
198
217
-
Since v4 PDF.js requires `.mjs` files support, make sure your server has it.
0 commit comments