<template>
<div id="viewer">
</div>
</template>
<script>
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
import 'bootstrap.css';
Vue.use(BootstrapVue)
let App = Vue.extend({
name: 'app',
data: function () {
return {
}
},
mounted: function () {
const viewer = new DsPdfViewer(this.$el, {
workerSrc: "/diodocs/pdfviewer/demos/product-bundles/build/dspdfviewer.worker.js",
restoreViewStateOnLoad: false,
language: "ja"
});
viewer.addDefaultPanels();
viewer.open("/diodocs/pdfviewer/demos/product-bundles/assets/pdf/helloworld.pdf");
},
beforeDestroy: function () { }
})
new Vue({ render: h => h(App) }).$mount('#app');
</script>
<style>
body {
margin-bottom: 0px;
}
label {
margin-right: 0px;
}
#viewer {
}
</style>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PDFの表示 (Vue)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- DsPdfViewer -->
<script src="/diodocs/pdfviewer/demos/product-bundles/build/dspdfviewer.js"></script>
<script src="/diodocs/pdfviewer/demos/product-bundles/build/wasmSupportApi.js"></script>
<script src="/diodocs/pdfviewer/demos/resource/js/init.js"></script>
<!-- SystemJS -->
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('./src/app.vue');
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>
export function getData() {
return [];
}
(function (global) {
System.config({
transpiler: 'plugin-babel',
babelOptions: {
es2015: true
},
meta: {
'*.css': { loader: 'css' },
'*.vue': { loader: 'vue-loader' }
},
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
'@mescius/dspdfviewer': 'npm:@mescius/dspdfviewer/dspdfviewer.js',
'bootstrap-vue': 'npm:bootstrap-vue/dist/bootstrap-vue.js',
'bootstrap.css': 'npm:bootstrap/dist/css/bootstrap.min.css',
'jszip': 'npm:jszip/dist/jszip.js',
'css': 'npm:systemjs-plugin-css/css.js',
'vue': 'npm:vue/dist/vue.min.js',
'vue-loader': 'npm:systemjs-vue-browser/index.js',
'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js',
'systemjs-babel-build': 'npm:systemjs-plugin-babel/systemjs-babel-browser.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
src: {
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
// "node_modules": {
// defaultExtension: 'js'
// },
}
});
})(this);