Welcome to the Vue PDF Viewer starter toolkit! This repository is a showcase of how Vue PDF Viewer can be integrated and rendered as part of an Ionic project.
-
Clone the Repository: If you haven't already, clone the repository and navigate into the project directory.
git clone https://github.com/your-username/starter-vpv-ionic-vue-js.git cd starter-vpv-ionic-vue-js
-
Install Dependencies: Install the necessary dependencies using npm, yarn, pnpm or bun
npm install # or yarn install # or pnpm install # or bun install
Remark: For pnpm
, there is a bit more configuration required which can be found here.
This repository includes an example project to demonstrate Vue PDF Viewer in action:
-
Start the Development Server: Use the following command to start the development server
ionic serve
-
Open in Browser: Open your browser and navigate to
http://localhost:8100
(or the port specified in your terminal) to see the example project in action
Once the example project is running, you can explore the source code to see how the Vue PDF Viewer component is integrated. Here is a brief overview:
-
Import the component: Import the desired Vue PDF Viewer component into your
HomPage
file<script setup> import { VPdfViewer } from "@vue-pdf-viewer/viewer"; import { IonPage, IonContent } from "@ionic/vue"; </script>
-
Use the component in the template: Add the Vue PDF Viewer component to your template section
<template> <ion-page> <ion-content class="ion-padding"> <VPdfViewer src="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" /> </ion-content> </ion-page> </template>
For more examples, please refer to the src/views/HomePage.vue
file in this repository:
- Default Toolbar
- Without Toolbar
Remark: If you would like more examples, feel free to open an issue.
For more configurations, please check the documentation site.
- Homepage: https://www.vue-pdf-viewer.dev
- Docs: https://docs.vue-pdf-viewer.dev
Thank you for using Vue PDF Viewer! We hope this toolkit helps you build amazing Ionic applications. If you have any questions or need further assistance on this example, please feel free to open an issue. Happy coding!