Vue3 Pdf App is a comprehensive Vue 3 component designed for displaying PDF documents within web applications. It is built upon Mozilla's robust PDF.js library, ensuring full compatibility with core PDF functionalities such as zooming, printing, downloading, rotation, text selection, and searching. The package is currently stable at version 1.0.3, actively maintained as a fork of `vue-pdf-app`, and appears to follow a regular release cadence given its recent updates. Key differentiators include its 100% PDF.js feature parity, easily localizable and highly configurable toolbar allowing for custom UI, extensive cross-browser support, and options for color customization, button icon themes, and light/dark modes. It also boasts built-in TypeScript support, providing a smooth development experience for type-safe applications. This component offers a robust, feature-rich solution for integrating PDF viewing directly into Vue 3 projects.
npm install vue3-pdf-appVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to embed a PDF viewer component, loading a sample PDF from a URL, and correctly applying necessary styling for rendering and toolbar icons.
Ensure the component or its direct parent has an explicit CSS `height` property set (e.g., `height: 100vh;` or a fixed pixel height). The example uses `style="height: 100vh;"` on a wrapper div.
Add `import 'vue3-pdf-app/dist/icons/main.css';` to your component's script section or global styles.
For Vue 3, use `v-model:theme="theme"` for two-way binding. If `theme` is only for initial setting, simply use `:theme="'dark'"` or `:theme="themeVariable"`.
Apply a CSS `height` property to the `<vue-pdf-app>` component directly, or wrap it in a `div` and set the `height` on the wrapper (e.g., `style="height: 100vh;"`).
Add `import 'vue3-pdf-app/dist/icons/main.css';` to your component's script section or to your main application's stylesheet entry point.
Ensure you are passing props correctly using `:prop-name="value"` syntax (e.g., `:pdf="myPdfUrl"`) and that the prop name matches exactly (case-sensitive) the component's expected prop definitions.