Appearance
PdfJsViewer Component ​
File Information ​
- Path:
app/components/preview/PdfJsViewer.vue - Purpose: In-app PDF preview with zoom, rotate, fit mode, thumbnails, and find-in-page; supports cross-origin via server proxy
- Type: Preview component
Overview ​
PdfJsViewer displays a PDF from a URL (typically an asset URL). It uses the usePdfJsViewer composable for loading, zoom, rotation, fit-to-page/width, sidebar thumbnails, and find-in-page. Cross-origin PDFs are loaded through the server proxy /api/pdf/proxy?url=... so credentials and CORS are handled on the server.
Props ​
- src:
string— PDF URL (asset URL or any HTTP(S) URL)
Events ​
- loaded:
{ pages: number }— Fired when the PDF is loaded successfully - error:
{ message: string }— Fired when loading fails
Composables ​
- usePdfJsViewer — All viewer state and methods (see usePdfJsViewer)
Related ​
- usePdfJsViewer - Viewer logic
- usePdfJs - Shared PDF.js instance
- Server API - PDF proxy
- Plugins - PDF.js