UNPKG

@mstechusa/eviewer7

Version:

[![](http://eviewer.net/wp-content/uploads/2021/04/Univerisal-eViewer-400x325.png)](https://eviewer.net)\r #### A HTML5-based document viewer built on Angular and JavaScript technologies for the highest level of performance and integration into your appli

117 lines (91 loc) 4.16 kB
# eViewer [![](http://eviewer.net/wp-content/uploads/2021/04/Univerisal-eViewer-400x325.png)](https://eviewer.net) #### A HTML5-based document viewer built on Angular and JavaScript technologies for the highest level of performance and integration into your applications. eViewer is multi-platform, multi-device compatible to provide the greatest versatility and amazing user experience. [![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger) ## Supported platform eViewer requires the following for deployment: - **Server OS:** Linux(x64) excluding Alpine, Windows(x64) - **Java:** 8 and higher ## eViewer Installation Install the dependencies and devDependencies and start the server. ## Install eViewer ```sh npm i eviewerjs --save This will also download all the assets that need to be included for eViewer to work. ``` ## Copy Assets ```sh Copy assets and resources to your public/static folder. These assets need to be served with your application. For example, if your project is built into a dist folder, you could copy these assets into dist/public. The folder you need to copy is node_modules/eviewerjs/assets. ``` ## Import and instantiate eViewer ```sh import eViewerApp from "eviewerjs/js/eViewer7 v1.0.5"; this.eViewerObj = new eViewerApp(); this.eViewerObj.loadViewer("viewer", null, null).then(() => { // Call API's to set viewer options if necessary }); await import("eviewerjs/scripts"); await import("eviewerjs/runtime"); await import("eviewerjs/polyfills"); await import("eviewerjs/main"); await import("eviewerjs/js/events"); ``` ## Load Document ```sh let docUrl = "http://www.africau.edu/images/default/sample.pdf"; let saveUrl = ""; let serverUrl = ""; let annotationUrl = ""; let userName = "demouser"; let isEditMode = true; let repoType = "filesystem"; let fileName = ""; let password = ""; let options = { type: "GET", headers: { Authorization: "Bearer ", }, }; this.eViewerObj.setDocumentEndPointOptions(options, saveUrl); let documentSrvc = this.eViewerObj.getDocumentService(); documentSrvc .loadDocument( docUrl, annotationUrl, userName, serverUrl, isEditMode, repoType, password, fileName ) .then((response) => { console.log("loadDocument"); }); ``` ## License Please visit https://eviewer.net or https://mstusa.com to learn more about licensing eViewer [//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax) [dill]: <https://github.com/joemccann/dillinger> [git-repo-url]: <https://github.com/joemccann/dillinger.git> [john gruber]: <http://daringfireball.net> [df1]: <http://daringfireball.net/projects/markdown/> [markdown-it]: <https://github.com/markdown-it/markdown-it> [Ace Editor]: <http://ace.ajax.org> [node.js]: <http://nodejs.org> [Twitter Bootstrap]: <http://twitter.github.com/bootstrap/> [jQuery]: <http://jquery.com> [@tjholowaychuk]: <http://twitter.com/tjholowaychuk> [express]: <http://expressjs.com> [AngularJS]: <http://angularjs.org> [Gulp]: <http://gulpjs.com> [PlDb]: <https://github.com/joemccann/dillinger/tree/master/plugins/dropbox/README.md> [PlGh]: <https://github.com/joemccann/dillinger/tree/master/plugins/github/README.md> [PlGd]: <https://github.com/joemccann/dillinger/tree/master/plugins/googledrive/README.md> [PlOd]: <https://github.com/joemccann/dillinger/tree/master/plugins/onedrive/README.md> [PlMe]: <https://github.com/joemccann/dillinger/tree/master/plugins/medium/README.md> [PlGa]: <https://github.com/RahulHP/dillinger/blob/master/plugins/googleanalytics/README.md>