npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alexdee2007/quasar-app-extension-qpdfviewer

v2.0.1

Published

QPdfviewer is an app extension for viewing PDF files

Downloads

2

Readme

QPdfViewer (@quasar/qpdfviewer)

npm (scoped) GitHub code size in bytes GitHub repo size in bytes npm

QPdfViewer is an UI App Extension for Quasar Framework v1. It will not work with legacy versions of Quasar Framework.

This work is currently in beta and there are expected changes while things get worked out. Your help with testing is greatly appreciated. Suggestions and PRs welcomed.

Info

QPdfViewer allows you to have PDF in your web pages.

Install

To add this App Extension to your Quasar application, run the following (in your Quasar app folder):

quasar ext add @quasar/qpdfviewer@next

Uninstall

To remove this App Extension from your Quasar application, run the following (in your Quasar app folder):

quasar ext remove @quasar/qpdfviewer

Describe

You can use quasar describe QPdfViewer

Test Project

In demo folder of app-extension-qpdfviewer.

Docs and Demo

Can be found here

Example Code

Be sure to check out the Test Project for more examples.

<q-pdfviewer
  src="'https://www.ets.org/Media/Tests/GRE/pdf/gre_research_validity_data.pdf'"
  type="pdfjs"
  content-class="absolute"
/>

or

<template>
  <div class="container q-pa-lg">
    <q-pdfviewer
      :src="src"
      type="html5"
      content-class="fit container"
      inner-content-class="fit container"
    />
  </div>
</template>

<script>
export default {
  name: 'Container',
  props: {
    src: String
  }
}
</script>

<style>
.container {
  max-width: 50%;
  max-height: 70%;
  min-width: 400px;
  min-height: 600px;
  width: 100%;
  height: 100%;
}
</style>

Using blob data (for type="html5" only):

fetchPDF (payload) {
  axios.post('/my/url/to/pdf', payload, { responseType: 'blob' })
    .then(res => {
      // create the blob
      const blob = new Blob([res.data], { type: res.data.type })
      // set reactive variable
      pdfSrc = window.URL.createObjectURL(blob)
    })
    .catch(err => {
      $q.notify({
        message: 'Error downloading PDF',
        type: 'negative',
        textColor: 'white',
        color: 'negative',
        icon: 'error',
        closeBtn: 'close',
        position: 'top'
      })
    })
}

NOTE: QPdfviewer now has support for native HTML5 PDF viewer and for PDFJS. Use type="html5" or type="pdfjs". If you previously had this app extension, and want to use the pdfjs, you will need to re-install it. An update will not get the PDFJS for you. If you update, you can run quasar ext invoke @quasar/qpdfviewer instead of re-installing.


NOTE: QPdfviewer uses the <object> tag for displaying the PDF (type="html5" only). Should the browser not support this, the fallback is to use an <iframe>. And, should this also not be supported by the browser, then some text will be displayed with a link to the PDF so the user can download it for off-line viewing.

When using PDFJS, the PDF is always displayed in an <iframe>.


NOTE: QPdfviewer now works with Electron, but you have to use type="pdfjs" to get this functionality.


QPdfviewer Vue Properties

| Vue Property | Type | Description | |---|---|---| | src | String | Path to the PDF source | | type | String | PDF engine to use (values: html5 or pdfjs) | | error-string | String | Set this if you wish to change from the default error string | | load | Function | The function to be called when the pdf document has been loaded | | error | Function | The function to be called when the pdf document has an error | | content-class | [String, Object, Array] | Style definitions to be attributed to the PDF container | | content-style | [String, Object, Array] | Style definitions to be attributed to the PDF container | | inner-content-class | [String, Object, Array] | Style definitions to be attributed to the PDF object | | inner-content-style | [String, Object, Array] | Style definitions to be attributed to the PDF object |

QPdfViewer has no events or slots.

Donate

If you appreciate the work that went into this App Extension, please consider donating to Quasar.