### Install Pdfvuer for Vue 2 Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md Use this command to install the library for Vue 2 projects. ```bash npm install --save pdfvuer ``` -------------------------------- ### Install Pdfvuer for Vue 3 Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md Use this command to install the library for Vue 3 projects. Ensure you use the '@next' tag. ```bash npm i pdfvuer@next --save ``` -------------------------------- ### Public static methods Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md Static methods available on the PDFVuer class. ```APIDOC ## Public static methods ### createLoadingTask(src) - **Parameters**: - `src`: see `:src` prop - **Description**: This function creates a PDFJS loading task that can be used and reused as `:src` property. ``` -------------------------------- ### Basic Pdfvuer Usage in Vue Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md A basic Vue component demonstrating how to use the Pdfvuer component to display a PDF. Includes a loading template. The 'pdfjs-dist/build/pdf.worker.entry' import is not needed since v1.9.1. ```vue ``` -------------------------------- ### Properties Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md Configuration options for the PDFVuer component. ```APIDOC ## Properties ### :resize - **Type**: Boolean - **Default**: false - **Description**: Enable Auto Resizing on window resize. By default, autoresizing is disabled. ### :annotation - **Type**: Boolean - **Default**: false - **Description**: Show the annotations in the pdf. By default, annotation layer is disabled. ### :text - **Type**: Boolean - **Default**: true - **Description**: Show the text layer in the pdf. By default, text layer is enabled. ``` -------------------------------- ### Events Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md Event handlers that can be triggered by the PDFVuer component. ```APIDOC ## Events ### @numpages - **Type**: Number - **Description**: The total number of pages of the pdf. ### @loading - **Type**: Boolean - **Description**: The provided PDF's loading state. ### @error - **Type**: Function - **Description**: Function handler for errors occurred during loading/drawing PDF source. ### @link-clicked - **Type**: Function - **Description**: Function handler for errors occurred during loading/drawing PDF source. #### Example ```js handle_pdf_link: function (params) { // Scroll to the appropriate place on our page - the Y component of // params.destArray * (div height / ???), from the bottom of the page div var page = document.getElementById(String(params.pageNumber)); page.scrollIntoView(); } ``` ``` -------------------------------- ### PDF Vuer Props Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md The PDF Vuer component accepts several props to control its functionality, including the source of the PDF, page number, rotation, and scaling. ```APIDOC ## Props ### :src *Type*: String / Object *Default*: '' *Description*: The url of the pdf file. `src` may also be a `string|TypedArray|DocumentInitParameters|PDFDataRangeTransport` for more details, see [`PDFJS.getDocument()`](https://github.com/mozilla/pdf.js/blob/880093377160614073217330880032613945819d/src/display/api.js#L117). ### :page *Type*: Number *Default*: 1 *Description*: The page number to display. ### :rotate *Type*: Number *Default*: 0 *Description*: The page rotation in degrees, only multiple of 90 are valid. ### :scale *Type*: Number / String *Default*: 'page-width' *Description*: The scaling factor. By default, the pdf will be scaled to match the page width with the container width. When passed value `page-width` and / or using `resize` prop, will send back the scale computed accordingly via `update:scale` event (use it with `scale.sync="scale"`). ``` -------------------------------- ### Advanced PDF Viewer Component Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md This Vue.js component provides a full-featured PDF viewer with page navigation, zoom controls, and link handling. It requires the 'pdfvuer' library and 'pdfjs-dist/build/pdf.worker.entry'. The component dynamically loads a PDF and updates the UI based on scroll position and user interactions. ```vue ``` -------------------------------- ### Handle PDF Link Click Event Source: https://github.com/arkokoley/pdfvuer/blob/master/README.md Use this handler to manage clicks on links within the PDF. It scrolls the page to the appropriate location based on the link's destination. ```js handle_pdf_link: function (params) { // Scroll to the appropriate place on our page - the Y component of // params.destArray * (div height / ???), from the bottom of the page div var page = document.getElementById(String(params.pageNumber)); page.scrollIntoView(); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.