Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@certifaction/vue-pdf-viewer

Package Overview
Dependencies
Maintainers
5
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@certifaction/vue-pdf-viewer - npm Package Compare versions

Comparing version 0.0.15 to 1.0.0

12

dist/certifaction-vue-pdf-viewer.common.js
/*!
* @certifaction/vue-pdf-viewer 0.0.14
* @certifaction/vue-pdf-viewer 0.0.15
*

@@ -207,6 +207,2 @@ * @link https://certifaction.com

props: {
url: {
type: String,
required: true
},
pdfjsWorkerSrc: {

@@ -223,2 +219,6 @@ type: String,

required: true
},
url: {
type: String,
required: true
}

@@ -324,3 +324,3 @@ },

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"pdf-viewer"},[_c('div',{ref:"viewerContainer",staticClass:"viewer-container"},[_c('div',{staticClass:"viewer"})]),_vm._v(" "),_c('div',{staticClass:"controls"},[_c('div',{staticClass:"pages"},[_vm._v("\n "+_vm._s(_vm._$t('pdfViewer.page'))+"\n "),_c('span',{staticClass:"current"},[_vm._v(_vm._s(_vm.currentPage))]),_vm._v(" / "),_c('span',{staticClass:"total"},[_vm._v(_vm._s(_vm.pageCount))])]),_vm._v(" "),_c('div',{staticClass:"scale"},[_c('button',{staticClass:"btn secondary",attrs:{"type":"button"},on:{"click":_vm.decreaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiMinus}})],1),_vm._v(" "),_c('button',{staticClass:"btn secondary",attrs:{"type":"button"},on:{"click":_vm.increaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiPlus}})],1),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.currentScale),expression:"currentScale"}],staticClass:"scale-selector",on:{"change":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.currentScale=$event.target.multiple ? $$selectedVal : $$selectedVal[0];}}},[_vm._l((_vm.scaleOptions),function(option){return _c('option',{key:option.value,domProps:{"value":option.value}},[_vm._v(_vm._s(option.label)+"\n ")])}),_vm._v(" "),_c('option',{staticClass:"hidden",attrs:{"disabled":""},domProps:{"value":_vm.customScale.value}},[_vm._v(_vm._s(_vm.customScale.label))])],2)])])])};
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"pdf-viewer"},[_c('div',{ref:"viewerContainer",staticClass:"viewer-container"},[_c('div',{staticClass:"viewer"})]),_vm._v(" "),_c('div',{staticClass:"controls"},[_c('div',{staticClass:"pages"},[_vm._v("\n "+_vm._s(_vm._$t('pdfViewer.page'))+"\n "),_c('span',{staticClass:"current"},[_vm._v(_vm._s(_vm.currentPage))]),_vm._v(" / "),_c('span',{staticClass:"total"},[_vm._v(_vm._s(_vm.pageCount))])]),_vm._v(" "),_c('div',{staticClass:"scale"},[_c('button',{staticClass:"btn",attrs:{"type":"button"},on:{"click":_vm.decreaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiMinus}})],1),_vm._v(" "),_c('button',{staticClass:"btn",attrs:{"type":"button"},on:{"click":_vm.increaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiPlus}})],1),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.currentScale),expression:"currentScale"}],staticClass:"scale-selector",on:{"change":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.currentScale=$event.target.multiple ? $$selectedVal : $$selectedVal[0];}}},[_vm._l((_vm.scaleOptions),function(option){return _c('option',{key:option.value,domProps:{"value":option.value}},[_vm._v(_vm._s(option.label)+"\n ")])}),_vm._v(" "),_c('option',{staticClass:"hidden",attrs:{"disabled":""},domProps:{"value":_vm.customScale.value}},[_vm._v(_vm._s(_vm.customScale.label))])],2)])])])};
var __vue_staticRenderFns__ = [];

@@ -327,0 +327,0 @@

/*!
* @certifaction/vue-pdf-viewer 0.0.14
* @certifaction/vue-pdf-viewer 0.0.15
*

@@ -203,6 +203,2 @@ * @link https://certifaction.com

props: {
url: {
type: String,
required: true
},
pdfjsWorkerSrc: {

@@ -219,2 +215,6 @@ type: String,

required: true
},
url: {
type: String,
required: true
}

@@ -320,3 +320,3 @@ },

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"pdf-viewer"},[_c('div',{ref:"viewerContainer",staticClass:"viewer-container"},[_c('div',{staticClass:"viewer"})]),_vm._v(" "),_c('div',{staticClass:"controls"},[_c('div',{staticClass:"pages"},[_vm._v("\n "+_vm._s(_vm._$t('pdfViewer.page'))+"\n "),_c('span',{staticClass:"current"},[_vm._v(_vm._s(_vm.currentPage))]),_vm._v(" / "),_c('span',{staticClass:"total"},[_vm._v(_vm._s(_vm.pageCount))])]),_vm._v(" "),_c('div',{staticClass:"scale"},[_c('button',{staticClass:"btn secondary",attrs:{"type":"button"},on:{"click":_vm.decreaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiMinus}})],1),_vm._v(" "),_c('button',{staticClass:"btn secondary",attrs:{"type":"button"},on:{"click":_vm.increaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiPlus}})],1),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.currentScale),expression:"currentScale"}],staticClass:"scale-selector",on:{"change":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.currentScale=$event.target.multiple ? $$selectedVal : $$selectedVal[0];}}},[_vm._l((_vm.scaleOptions),function(option){return _c('option',{key:option.value,domProps:{"value":option.value}},[_vm._v(_vm._s(option.label)+"\n ")])}),_vm._v(" "),_c('option',{staticClass:"hidden",attrs:{"disabled":""},domProps:{"value":_vm.customScale.value}},[_vm._v(_vm._s(_vm.customScale.label))])],2)])])])};
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"pdf-viewer"},[_c('div',{ref:"viewerContainer",staticClass:"viewer-container"},[_c('div',{staticClass:"viewer"})]),_vm._v(" "),_c('div',{staticClass:"controls"},[_c('div',{staticClass:"pages"},[_vm._v("\n "+_vm._s(_vm._$t('pdfViewer.page'))+"\n "),_c('span',{staticClass:"current"},[_vm._v(_vm._s(_vm.currentPage))]),_vm._v(" / "),_c('span',{staticClass:"total"},[_vm._v(_vm._s(_vm.pageCount))])]),_vm._v(" "),_c('div',{staticClass:"scale"},[_c('button',{staticClass:"btn",attrs:{"type":"button"},on:{"click":_vm.decreaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiMinus}})],1),_vm._v(" "),_c('button',{staticClass:"btn",attrs:{"type":"button"},on:{"click":_vm.increaseScale}},[_c('MDIcon',{attrs:{"icon":_vm.mdiPlus}})],1),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.currentScale),expression:"currentScale"}],staticClass:"scale-selector",on:{"change":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.currentScale=$event.target.multiple ? $$selectedVal : $$selectedVal[0];}}},[_vm._l((_vm.scaleOptions),function(option){return _c('option',{key:option.value,domProps:{"value":option.value}},[_vm._v(_vm._s(option.label)+"\n ")])}),_vm._v(" "),_c('option',{staticClass:"hidden",attrs:{"disabled":""},domProps:{"value":_vm.customScale.value}},[_vm._v(_vm._s(_vm.customScale.label))])],2)])])])};
var __vue_staticRenderFns__ = [];

@@ -323,0 +323,0 @@

{
"name": "@certifaction/vue-pdf-viewer",
"version": "0.0.15",
"version": "1.0.0",
"description": "PDF-Viewer for Vue.js based on Mozillas PDF.js",

@@ -31,3 +31,3 @@ "private": false,

"dependencies": {
"@certifaction/pdfjs": "^0.0.15",
"@certifaction/pdfjs": "^1.0.0",
"@mdi/js": "^5.9.55",

@@ -41,10 +41,10 @@ "core-js": "^3.9.1"

"devDependencies": {
"@babel/core": "^7.13.8",
"@babel/preset-env": "^7.13.9",
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"autoprefixer": "^10.2.4",
"autoprefixer": "^10.2.5",
"babel-eslint": "^10.1.0",
"eslint": "^7.21.0",
"eslint": "^7.22.0",
"eslint-config-standard": "^16.0.2",

@@ -58,3 +58,3 @@ "eslint-plugin-import": "^2.22.1",

"rimraf": "^3.0.2",
"rollup": "^2.40.0",
"rollup": "^2.41.4",
"rollup-plugin-vue": "^5.1.9",

@@ -64,3 +64,3 @@ "vue": "^2.6.12",

},
"gitHead": "e4912eeac73e5ad17e3a9fb7574d35ec3e29176c"
"gitHead": "b3beabda98eb2cb462f060d0114e9359e6dbe425"
}
# @certifaction/vue-pdf-viewer
[![npm][npm]][npm-url]
[![lerna][lerna]][lerna-url]
PDF-Viewer for Vue.js based on Mozillas PDF.js
## Table of contents
* [Install](#install)
* [As NPM package](#as-npm-package)
* [Usage](#usage)
* [ES6](#es6)
* [Load locales](#load-locales)
* [Load stylesheet](#load-stylesheet)
* [License](#license)
## Install
### As NPM package
```shell script
npm install @certifaction/vue-pdf-viewer
# or if using yarn
yarn add @certifaction/vue-pdf-viewer
```
## Usage
### ES6
```js
import PDFViewer from '@certifaction/vue-pdf-viewer'
new Vue({
components: {
PDFViewer
}
})
```
### Load locales
Example code how to load the component translations:
```js
import merge from 'lodash.merge'
import pdfViewerEN from '@certifaction/vue-pdf-viewer/src/locales/en.json'
import pdfViewerDE from '@certifaction/vue-pdf-viewer/src/locales/de.json'
import pdfViewerFR from '@certifaction/vue-pdf-viewer/src/locales/fr.json'
import pdfViewerIT from '@certifaction/vue-pdf-viewer/src/locales/it.json'
function loadLocaleMessages() {
// Load your messages
}
const messages = merge({
en: pdfViewerEN,
de: pdfViewerDE,
fr: pdfViewerFR,
it: pdfViewerIT
}, loadLocaleMessages())
new VueI18n({
messages
})
```
### Load stylesheet
```scss
$pdf-viewer-asset-base-path: "/node_modules/@certifaction/pdfjs/dist/";
@import "@certifaction/vue-pdf-viewer/src/style/index";
```
## Props
### pdfjsWorkerSrc
Type: `string` | Required: `false` (either [`pdfjsWorkerSrc`](#pdfjsworkersrc) or [`pdfjsWorkerInstance`](#pdfjsworkerinstance) is required)
URL to the pdfjs.worker.js or pdfjs.worker.min.js.
### pdfjsWorkerInstance
Type: `Worker` | Required: `false` (either [`pdfjsWorkerInstance`](#pdfjsworkerinstance) or [`pdfjsWorkerSrc`](#pdfjsworkersrc) is required)
When the worker is loaded with the Webpack [worker-loader](https://www.npmjs.com/package/worker-loader), you can also pass the instance of the worker.
vue.config.js example:
```js
chainWebpack: config => {
config.module
.rule('js')
.exclude.add(/\.worker\.js$/)
config.module
.rule('worker')
.test(/\.worker(\.min)?\.js$/)
.use('worker-loader')
.loader('worker-loader')
.options({ filename: 'js/[name].[hash:8].js' })
.end()
}
```
Usage example:
```vue
<template>
<div class="test">
<PDFViewer :pdfjs-worker-instance="pdfjsWorker"/>
</div>
</template>
<script>
import PdfjsWorker from '@certifaction/pdfjs/dist/pdfjs.worker.min'
export default {
name: 'Test',
components: {
PDFViewer
},
data() {
return {
pdfjsWorker: new PdfjsWorker()
}
}
}
</script>
```
### pdfjsCMapUrl
Type: `string` | Required: `true`
Pass the path where the cmaps can be accessed.
vue.config.js example to copy the cmaps to the dist folder:
```js
chainWebpack: config => {
config.plugin('copy')
.tap(args => {
args[0].push({
from: '@certifaction/pdfjs/dist/cmaps',
to: 'pdf/cmaps',
toType: 'dir',
context: './node_modules'
})
return args
})
}
```
### url
Type: `string` | Required: `true`
URL of the PDF document which should be displayed.
## License
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/certifaction/js-pdf-viewer/blob/master/LICENSE)
Released by [Certifaction AG](https://certifaction.com)
[npm]: https://img.shields.io/npm/v/@certifaction/vue-pdf-viewer.svg
[npm-url]: https://www.npmjs.com/package/@certifaction/vue-pdf-viewer
[lerna]: https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg
[lerna-url]: https://lerna.js.org/
import './pdf.init'
import { pdfjsViewer } from '@certifaction/pdfjs'
// import pdfjsViewer from '@certifaction/pdfjs/dist/pdf_viewer.js'
// import * as pdfjsViewer from 'pdfjs-dist/web/pdf_viewer'
// console.log(window['pdfjs-dist/build/pdf'])
delete window['pdfjs-dist/build/pdf']
export default pdfjsViewer
import { pdfjsLib } from '@certifaction/pdfjs'
// import pdfjsLib from '@certifaction/pdfjs/dist/pdf.js'
// import * as pdfjsLib from 'pdfjs-dist/build/pdf'
window['pdfjs-dist/build/pdf'] = pdfjsLib

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc