@ezeep/ngx-ezeep-js 1.0.131 → 1.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,97 @@
|
|
|
2
2
|
|
|
3
3
|
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0.
|
|
4
4
|
|
|
5
|
+
## Integration in your Angular App
|
|
6
|
+
Important: You need to set up your server with https!
|
|
7
|
+
|
|
8
|
+
1. Inside your Angular App, install the package via npm:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @ezeep/ezeep-js
|
|
12
|
+
```
|
|
13
|
+
2. Import the EzeepJSAngularModule in the module of your choice (e.g. app module)
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { NgModule } from '@angular/core';
|
|
17
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
18
|
+
import { EzeepJSAngularModule } from '@ezeep/ngx-ezeep-js';
|
|
19
|
+
|
|
20
|
+
import { AppComponent } from './app.component';
|
|
21
|
+
|
|
22
|
+
@NgModule({
|
|
23
|
+
declarations: [
|
|
24
|
+
AppComponent
|
|
25
|
+
],
|
|
26
|
+
imports: [
|
|
27
|
+
BrowserModule,
|
|
28
|
+
EzeepJSAngularModule
|
|
29
|
+
],
|
|
30
|
+
providers: [],
|
|
31
|
+
bootstrap: [AppComponent]
|
|
32
|
+
})
|
|
33
|
+
export class AppModule { }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. The package comes with assets, to use them, do the following:
|
|
37
|
+
|
|
38
|
+
3.1 In the angluar.json file of your project, add this:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
...
|
|
42
|
+
"assets": [
|
|
43
|
+
{
|
|
44
|
+
"glob": "**/*",
|
|
45
|
+
"input": "./node_modules/@ezeep/ezeep-js/dist/ezeep/assets",
|
|
46
|
+
"output": "./assets/"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
...
|
|
50
|
+
```
|
|
51
|
+
3.2 Additionally, you need to tell stencil where to find the assets, so add this to your main.ts file
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
...
|
|
55
|
+
import { setAssetPath } from '@stencil/core'
|
|
56
|
+
...
|
|
57
|
+
setAssetPath(location.origin)
|
|
58
|
+
...
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
4. Add the **ezp-printing** tag to your html source.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<ezp-printing></ezp-printing>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
There are multiple required and optional attributes the ezp-printing element needs in order to provide the print functionality.
|
|
68
|
+
|
|
69
|
+
| Attribute | Description | Type | Required |
|
|
70
|
+
| --------------- | -------------------------------------------------------------------------------------------------------- | ------- | -------- |
|
|
71
|
+
| **clientid** | Your registered Client-ID (see above). | string | Yes |
|
|
72
|
+
| **redirecturi** | Your registered Redirect Uri (see above). | string | Yes |
|
|
73
|
+
| **fileurl** | A url pointing to a file that should be printed. E.g. https://your-site.com/myfile.pdf | string | Yes |
|
|
74
|
+
| custom | Needs to be set to true, if a custom html element instead of the ezp-printing tag is used (e.g. button). | boolean | No |
|
|
75
|
+
| filename | The name of the file that is printed. | string | No |
|
|
76
|
+
| filetype | The type of the file that is printed. | string | No |
|
|
77
|
+
| hidelogin | If set to true, no additional info popup is shown before the user authentication. | boolean | No |
|
|
78
|
+
| authapihosturl | Overrides the default URL of the authentication API. | string | No |
|
|
79
|
+
| printapihosturl | Overrides the default URL of the printing API. | string | No |
|
|
80
|
+
|
|
81
|
+
### Example
|
|
82
|
+
|
|
83
|
+
To get started, you can use the default ezeep print button within your angular app:
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<ezp-printing
|
|
87
|
+
clientid="your-client-id"
|
|
88
|
+
redirecturi="https://your-site.com/"
|
|
89
|
+
fileurl="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
|
|
90
|
+
filename="dummypdf"
|
|
91
|
+
filetype="pdf"
|
|
92
|
+
>
|
|
93
|
+
</ezp-printing>
|
|
94
|
+
```
|
|
95
|
+
|
|
5
96
|
## Code scaffolding
|
|
6
97
|
|
|
7
98
|
Run `ng generate component component-name --project ngx-ezeep-js` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-ezeep-js`.
|