Skip to content

Update Nuxt js sample #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webviewer-angular/src/app/webviewer/webviewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class WebViewerComponent implements AfterViewInit {
WebViewer({
path: '../../lib/webviewer',
licenseKey: 'your_license_key', // sign up to get a free trial key at https://dev.apryse.com
initialDoc: '/files/WebviewerDemoDoc.pdf'
initialDoc: 'https://apryse.s3.amazonaws.com/public/files/samples/WebviewerDemoDoc.pdf'
}, this.viewer.nativeElement).then(instance => {

const { documentViewer, Annotations, annotationManager } = instance.Core;
Expand Down
Binary file removed webviewer-angular/src/files/WebviewerDemoDoc.pdf
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion webviewer-nextjs-14/src/components/WebViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Viewer() {
WebViewer(
{
path: '/lib/webviewer',
initialDoc: '/files/WebviewerDemoDoc.pdf',
initialDoc: 'https://apryse.s3.amazonaws.com/public/files/samples/WebviewerDemoDoc.pdf',
licenseKey: 'your_license_key' // sign up to get a free trial key at https://dev.apryse.com
},
viewer.current,
Expand Down
1 change: 1 addition & 0 deletions webviewer-nuxtjs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ sw.*

# WebViewer Core and UI files
static/webviewer
static/lib/webviewer

3 changes: 1 addition & 2 deletions webviewer-nuxtjs/components/WebViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
export default {
name: 'WebViewer',
props: {
path: String,
url: String
},
mounted () {
import('@pdftron/webviewer').then(() => {
WebViewer.Iframe({
path: '../webviewer',
path: '/lib/webviewer',
initialDoc: this.url, // replace with your own PDF file
licenseKey: 'your_license_key' // sign up to get a free trial key at https://dev.apryse.com
}, this.$refs.viewer).then((instance) => {
Expand Down
1 change: 0 additions & 1 deletion webviewer-nuxtjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions webviewer-nuxtjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"dev": "npm run copy-webviewer && nuxt",
"build": "npm run copy-webviewer && nuxt build",
"generate": "nuxt generate",
"start": "nuxt start",
"postinstall": "node tools/copy-webviewer-files.js"
"start": "npm run copy-webviewer && nuxt start",
"copy-webviewer": "node scripts/copy-webviewer-files.cjs"
},
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
Expand Down
5 changes: 3 additions & 2 deletions webviewer-nuxtjs/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<div id="app">
<WebViewer :path="`${publicPath}webviewer`"
url="https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf" />
<WebViewer
url="https://apryse.s3.amazonaws.com/public/files/samples/WebviewerDemoDoc.pdf"
/>
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
const fs = require('fs-extra');

/**
* Learn more about this script at https://docs.apryse.com/web/guides/get-started/copy-assets
*/

const copyFiles = async () => {
try {
await fs.copy('./node_modules/@pdftron/webviewer/public', './static/webviewer/');
await fs.copy('./node_modules/@pdftron/webviewer/public', './static/lib/webviewer/');
console.log('WebViewer files copied over successfully');
} catch (err) {
console.error(err);
Expand Down
Binary file removed webviewer-react/public/files/WebviewerDemoDoc.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion webviewer-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const App = () => {
WebViewer(
{
path: '/lib/webviewer',
initialDoc: '/files/WebviewerDemoDoc.pdf',
initialDoc: 'https://apryse.s3.amazonaws.com/public/files/samples/WebviewerDemoDoc.pdf',
licenseKey: 'your_license_key', // sign up to get a free trial key at https://dev.apryse.com
},
viewer.current,
Expand Down
Binary file removed webviewer-vue/public/files/WebviewerDemoDoc.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion webviewer-vue/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="app">
<WebViewer
initialDoc="/files/WebviewerDemoDoc.pdf"
initialDoc="https://apryse.s3.amazonaws.com/public/files/samples/WebviewerDemoDoc.pdf"
/>
</div>
</template>
Expand Down