Skip to content
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

Corrected compile errors #2

Open
wants to merge 2 commits into
base: master
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
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Copyright 2018 PDFTron Systems Inc. All rights reserved.
WebViewer React UI project/codebase or any derived works is only permitted in solutions with an active commercial PDFTron WebViewer license. For exact licensing terms please refer to your commercial WebViewer license. For use in other scenario, please contact sales@pdftron.com
Copyright 2023 Apryse Software Inc. All rights reserved.
WebViewer React UI project/codebase or any derived works is only permitted in solutions with an active commercial Apryse WebViewer license. For exact licensing terms refer to your commercial WebViewer license. For use in other scenario, contact sales@apryse.com.
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# WebViewer - AngularJS sample

[WebViewer](https://www.pdftron.com/webviewer) is a powerful JavaScript-based PDF Library that's part of the [PDFTron PDF SDK](https://www.pdftron.com). It provides a slick out-of-the-box responsive UI that interacts with the core library to view, annotate and manipulate PDFs that can be embedded into any web project.
[WebViewer](https://www.pdftron.com/webviewer) is a powerful JavaScript-based PDF Library that is part of the [Apryse SDK](https://www.pdftron.com). It provides a slick out-of-the-box responsive UI that interacts with the core library to view, annotate, and manipulate PDFs that can be embedded into any web project.

![WebViewer UI](https://www.pdftron.com/downloads/pl/webviewer-ui.png)

This repo is specifically designed for any users interested in integrating WebViewer into AngularJS project. See [AngularJS.org](https://angularjs.org) for more information.
This repo is specifically designed for any users interested in integrating WebViewer into [AngularJS](https://angularjs.org).

## Initial setup

Before you begin, make sure your development environment includes [Node.js](https://nodejs.org/en/).
Before you begin, make sure your development environment includes:

1. [Node.js](https://nodejs.org/en).
2. IDE used in this sample is Visual Studio Code.
3. [GitHub command line](https://github.com/git-guides/install-git) `git`.
4. Angular CLI: `npm install -g @angular/cli`. If an unsupported engine message appears, make sure to install a compatible NodeJS version.

## Install

```
git clone https://github.com/PDFTron/webviewer-angularjs-sample.git
gh repo clone ApryseSDK/webviewer-angularjs-sample
cd webviewer-angularjs-sample
npm install
```
Expand All @@ -26,13 +31,9 @@ npm start

Navigate to `http://localhost:3000/`. The app will automatically reload if you change any of the source files.

## WebViewer APIs

See [API documentation](https://www.pdftron.com/documentation/web/guides/ui/apis).

## Enabling full API

PDFNetJS Full is a complete browser side PDF SDK, unlocking viewing, parsing and editing of PDF files. To enable full API, you can modify constructor in components.js:
Webviewer Full is a complete browser side PDF SDK, unlocking viewing, parsing and editing of PDF files. To enable full API, you can modify constructor in components.js:

```diff
WebViewer({
Expand All @@ -42,13 +43,22 @@ WebViewer({
}, document.getElementById('viewer'))
```

You can refer to this [guide for more information](https://www.pdftron.com/documentation/web/guides/full-api)
Visit Apryse's [WebViewer](https://docs.apryse.com/documentation/web/) page to see what else you can do with the WebViewer.

## WebViewer APIs

* [@pdftron/webviewer API documentation](https://docs.apryse.com/api/web/global.html#WebViewer__anchor)
* [@pdftron/webviewer-angularjs](https://github.com/ApryseSDK/webviewer-angularjs-sample)

## Showcase

Refer to a running sample on Apryse SDK [showcase page](https://showcase.apryse.com/).

## Contributing

See [contributing](./CONTRIBUTING.md).
Any submission to this repo is governed by these [guidelines](/CONTRIBUTING.md).


## License

See [license](./LICENSE).
![](https://onepixel.pdftron.com/webviewer-angularjs-sample)
For licensing, refer to [License](LICENSE).
23 changes: 12 additions & 11 deletions app/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ angular.module('components', [])
initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf',
// initialDoc: '/path/to/my/file.pdf', // You can also use documents on your server
}, document.getElementById('viewer'))
.then(function(instance) {
var docViewer = instance.docViewer;
var annotManager = instance.annotManager;
// call methods from instance, docViewer and annotManager as needed
.then(function(instance) {
var docViewer = instance.Core.documentViewer;
var annotManager = instance.Core.annotationManager;
// call methods from instance, docViewer and annotManager as needed

// you can also access major namespaces from the instance as follows:
// var Tools = instance.Tools;
// var Annotations = instance.Annotations;
// you can also access major namespaces from the instance as follows:
var Tools = instance.Core.Tools;
var Annotations = instance.Core.Annotations;

// change to dark theme
instance.setTheme('dark');
// change to dark theme
instance.UI.setTheme('dark');

docViewer.on('documentLoaded', function() {
// call methods relating to the loaded document
docViewer.addEventListener('documentLoaded', function () {
console.log("Document is loaded.");
});
});
});
},
template: "<div id='viewer' style='width: 100%; height: 100%; margin: 0 auto;'></div>",
replace: true
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
"version": "1.0.0",
"scripts": {
"start": "npm run server",
"server": "./node_modules/.bin/supervisor -k -e html,js -i .git/,node_modules/ -- server.js",
"server": "node_modules\\.bin\\supervisor -k -e html,js -i .git/,node_modules/ -- server.js",
"postinstall": "npm run download-webviewer",
"download-webviewer": "npx @pdftron/webviewer-downloader --webviewerLocation app/lib"
},
"devDependencies": {
"body-parser": "1.18.3",
"express": "^4.16.3",
"@pdftron/webviewer-downloader": "^1.4.2",
"body-parser": "^1.20.3",
"express": "^4.21.0",
"morgan": "^1.9.1",
"opn": "^5.3.0",
"supervisor": "0.12.0",
"@pdftron/webviewer-downloader": "^1.1.0"
"opn": "^6.0.0",
"supervisor": "0.12.0"
},
"repository": {
"type": "git",
"url": ""
},
"author": "PDFTron Systems Inc."
"author": "PDFTron Systems Inc.",
"dependencies": {
"npm": "^10.8.3"
}
}