https://github.com/foxitsoftware/ngx-foxitpdfsdkforweb
https://github.com/foxitsoftware/ngx-foxitpdfsdkforweb
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/foxitsoftware/ngx-foxitpdfsdkforweb
- Owner: foxitsoftware
- License: other
- Created: 2019-07-29T11:19:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T20:35:54.000Z (over 2 years ago)
- Last Synced: 2025-01-15T10:55:08.479Z (over 1 year ago)
- Language: CSS
- Size: 30.6 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: license-key.js
Awesome Lists containing this project
README
# ngx-foxitpdfsdkforweb
This is Foxit pdf web sdk for Angular.
## Install
npm install ngx-foxitpdfsdkforweb --save
## Setup
1 Modify your angular.json
```
"assets": [
...,
{"glob": "**/*", "input": "./node_modules/ngx-foxitpdfsdkforweb/lib", "output": "/node_modules/ngx-foxitpdfsdkforweb/lib"}
],
```
2 Modify your tsconfig.json
```
"files": [
...
"node_modules/ngx-foxitpdfsdkforweb/foxitWebPDFComponent.ts"
],
```
3 Add FoxitWebPDFComponent to app NgModule.
```
import { FoxitWebPDFComponent } from 'ngx-foxitpdfsdkforweb';
@NgModule({
declarations: [
...
FoxitWebPDFComponent,
],
...
})
```
4 Copy license-key.js to folder src/app and import.
```
import { licenseSN, licenseKey} from './license-key';
```
## Use
1 You can add the tag in the template and set attribute fileUrl. The style position MUST be absolute.
```
```
### Attribute
* licenseSN
* licenseKey
* fileUrl
* password
2 You can also open pdf in the typescript code.
### Template
```
```
### Component
```
import { Component, Input, ViewChild } from '@angular/core';
import { licenseSN, licenseKey} from './license-key';
import { FoxitWebPDFComponent } from 'ngx-foxitpdfsdkforweb';
export class AppComponent {
@ViewChild('foxitWebPDF', {static: false}) foxitWebPDF:FoxitWebPDFComponent;
licenseSN = licenseSN;
licenseKey = licenseKey;
openPDF($event){
const fileSelected: File = $event.target.files[0];
this.foxitWebPDF.openFile(fileSelected);
}
openPDFByUrl(url:string){
this.foxitWebPDF.openPDFByHttpRangeRequest(url);
}
}
```