Skip to content

vue-pdf-viewer/starter-vpv-quasar

Repository files navigation

Vue PDF Viewer Starter Starter Toolkit in Quasar

Welcome to the Vue PDF Viewer starter toolkit! This repository provides a comprehensive guide on how to use Vue PDF Viewer Starter with Quasar. This repo showcases how Vue PDF Viewer Starter can be integrated and rendered as part of a Quasar project.

Table of Contents

Usage

Project Setup

  1. Clone the Repository: If you haven't already, clone the repository and navigate into the project directory.
git clone https://github.com/vue-pdf-viewer/starter-vpv-quasar.git
cd starter-vpv-quasar
  1. 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.

Running the Example Project

This repository includes an example project to demonstrate Vue PDF Viewer in action:

  1. Start the Development Server: Use the following command to start the development server

    npm run dev
    # or
    yarn dev
    # or
    pnpm run dev
    # or
    bun run dev
  2. Open in Browser: Open your browser and navigate to http://localhost:9000 (or the port specified in your terminal) to see the example project in action

Using the Vue PDF Viewer Starter Component

Once the example project is running, you can explore the source code to see how the Vue PDF Viewer Starter component is integrated. Here is a brief overview:

  1. Import the component: Import the desired Vue PDF Viewer Starter component into your Vue file
<script setup lang="ts">
  import { VPdfViewer } from '@vue-pdf-viewer/viewer';

  const pdfFileSource =
    'https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf';
</script>
  1. Use the component in the template: Add the Vue PDF Viewer Starter component to your template section

    <template>
      <div :style="{ width: '1028px', height: '700px' }">
        <VPdfViewer :src="pdfFileSource" />
      </div>
    </template>

Examples

For more examples, please refer to the src/page/IndexPage.vue file in this repository:

  • Default Toolbar
  • Without Toolbar
  • Mobile View

Remark: If you would like more examples, feel free open an issue.

For more configurations, please check the documentation site.

Meta


Thank you for using Vue PDF Viewer! We hope this toolkit helps you build amazing Vue 3 with Quasar applications. If you have any questions or need further assistance on this example, please feel free to open an issue. Happy coding!