@ezeep/ngx-ezeep-js 1.0.133 → 1.0.137

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.
Files changed (2) hide show
  1. package/README.md +75 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0.
4
4
 
5
+ ## Overview
6
+
7
+ The ezeep.js JavaScript library implements the [ezeep Blue API](https://apidocs.ezeep.com/) to easily offer printing capabilities to any web application. Integrate a printing feature to your web application with just a few steps.
8
+
9
+ ## Integration Guide
10
+
11
+ ### Getting started
12
+
13
+ 1. Sign up for an ezeep Blue account. This creates an **administrator account** and a new **ezeep organization**.
14
+ [Sign up here](https://www.ezeep.com/blue/)
15
+
16
+ 2. Register your web application to receive your **Client-ID**. Contact the ezeep team at <helpdesk@ezeep.com> and provide the **Redirect Uri** of your web application. This Uri must host the ezeep.js component.
17
+
18
+
5
19
  ## Integration in your Angular App
6
20
  Important: You need to set up your server with https!
7
21
 
@@ -32,7 +46,33 @@ import { AppComponent } from './app.component';
32
46
  })
33
47
  export class AppModule { }
34
48
  ```
35
- 3. Add the **ezp-printing** tag to your html source.
49
+
50
+ 3. The package comes with assets, to use them, do the following:
51
+
52
+ 3.1 In the angluar.json file of your project, add this:
53
+
54
+ ```json
55
+ ...
56
+ "assets": [
57
+ {
58
+ "glob": "**/*",
59
+ "input": "./node_modules/@ezeep/ezeep-js/dist/ezeep/assets",
60
+ "output": "./assets/"
61
+ }
62
+ ],
63
+ ...
64
+ ```
65
+ 3.2 Additionally, you need to tell stencil where to find the assets, so add this to your main.ts file
66
+
67
+ ```typescript
68
+ ...
69
+ import { setAssetPath } from '@stencil/core'
70
+ ...
71
+ setAssetPath(location.origin)
72
+ ...
73
+ ```
74
+
75
+ 4. Add the **ezp-printing** tag to your html source.
36
76
 
37
77
  ```html
38
78
  <ezp-printing></ezp-printing>
@@ -51,6 +91,7 @@ There are multiple required and optional attributes the ezp-printing element nee
51
91
  | hidelogin | If set to true, no additional info popup is shown before the user authentication. | boolean | No |
52
92
  | authapihosturl | Overrides the default URL of the authentication API. | string | No |
53
93
  | printapihosturl | Overrides the default URL of the printing API. | string | No |
94
+ | theme | The overall color theme. Possible colors are pink, red, orange, green, cyan, blue and violet. | string | No |
54
95
 
55
96
  ### Example
56
97
 
@@ -67,6 +108,39 @@ To get started, you can use the default ezeep print button within your angular a
67
108
  </ezp-printing>
68
109
  ```
69
110
 
111
+ ### Example with a custom button
112
+
113
+ Add the custom attribute to the **ezeep-printing** tag:
114
+
115
+ **component.html**
116
+ ```html
117
+ <ezp-printing
118
+ clientid="your-client-id"
119
+ redirecturi="https://your-site.com/"
120
+ fileurl="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
121
+ filename="dummypdf"
122
+ filetype="pdf"
123
+ custom
124
+ >
125
+ <button (click)="onClick()">My custom button</button>
126
+ </ezp-printing>
127
+ ```
128
+ Call the **open** function on the element:
129
+
130
+ **component.ts**
131
+ ```typescript
132
+ export class AppComponent implements OnInit {
133
+ ezpPrinting: any;
134
+
135
+ ngOnInit() {
136
+ this.ezpPrinting = document.querySelector('ezp-printing');
137
+ }
138
+
139
+ onClick() {
140
+ this.ezpPrinting.open();
141
+ }
142
+ }
143
+ ```
70
144
  ## Code scaffolding
71
145
 
72
146
  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`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezeep/ngx-ezeep-js",
3
- "version": "1.0.133",
3
+ "version": "1.0.137",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.0",
6
6
  "@angular/core": "^12.2.0"