@ezeep/ngx-ezeep-js 1.0.164 → 1.0.167

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 +122 -38
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -80,52 +80,136 @@ export class AppModule { }
80
80
 
81
81
  There are multiple required and optional attributes the ezp-printing element needs in order to provide the print functionality.
82
82
 
83
- | Attribute | Description | Type | Required |
84
- | --------------- | -------------------------------------------------------------------------------------------------------- | ------- | -------- |
85
- | **clientid** | Your registered Client-ID (see above). | string | Yes |
86
- | **redirecturi** | Your registered Redirect Uri (see above). | string | Yes |
87
- | **fileurl** | A url pointing to a file that should be printed. E.g. https://your-site.com/myfile.pdf | string | Yes |
88
- | 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 |
89
- | filename | The name of the file that is printed. | string | No |
90
- | filetype | The type of the file that is printed. | string | No |
91
- | hidelogin | If set to true, no additional info popup is shown before the user authentication. | boolean | No |
92
- | authapihosturl | Overrides the default URL of the authentication API. | string | No |
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 |
95
-
96
- ### Example
97
-
98
- To get started, you can use the default ezeep print button within your angular app:
83
+ | Attribute | Description | Type | Required |
84
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------- |
85
+ | **clientid** | Your registered Client-ID (see above). | string | Yes |
86
+ | **redirecturi** | Your registered Redirect Uri (see above). | string | Yes |
87
+ | **trigger** | _button_: renders a print button that opens the print dialog upon clicking it<br />_custom_: renders no element, but allows create a custom element or trigger to open the print dialog<br />_file_: renders a an area to allow drag and drop of a file | string | Yes |
88
+ | **fileurl** | A url pointing to a file that should be printed. E.g. https://your-site.com/myfile.pdf | string | Required, if trigger is set to _button_ or _custom_. |
89
+ | filename | The name of the file that is printed. | string | No. Only used for trigger _button_ and _custom_. |
90
+ | filetype | The type of the file that is printed. | string | No. Only used for trigger _button_ and _custom_. |
91
+ | hidelogin | If set to true, no additional info popup is shown before the user authentication. | boolean | No |
92
+ | hidemenu | If set to true, the menu is not shown. | boolean | No |
93
+ | authapihosturl | Overrides the default URL of the authentication API. | string | No |
94
+ | printapihosturl | Overrides the default URL of the printing API. | string | No |
95
+ | theme | The overall color theme. Possible colors are pink, red, orange, green, cyan, blue and violet. | string | No |
96
+ | appearance | Sets the overall appearance to "light", "dark" or the "system" default. | string | No
97
+ | language | Overrides the browserlanguage. Possible values are "de" for German and "en" for English. | string | No
98
+
99
+ ### Example with button trigger
100
+
101
+ To get started, you can use the default ezeep print button within your web app:
102
+
103
+ **component.html**
99
104
 
100
105
  ```html
101
- <ezp-printing
102
- clientid="your-client-id"
103
- redirecturi="https://your-site.com/"
104
- fileurl="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
105
- filename="dummypdf"
106
- filetype="pdf"
107
- >
108
- </ezp-printing>
106
+ <!DOCTYPE html>
107
+ <html dir="ltr" lang="en">
108
+ <head>
109
+ <meta charset="utf-8" />
110
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
111
+ <script type="module" src="https://cdn.ezeep.com/ezeep-js/ezeep.esm.js"></script>
112
+ <script nomodule src="https://cdn.ezeep.com/ezeep-js/ezeep.js"></script>
113
+ <title>ezeep-js</title>
114
+ </head>
115
+ <body>
116
+ <ezp-printing
117
+ clientid="your-client-id"
118
+ redirecturi="https://your-site.com/"
119
+ trigger="button"
120
+ fileurl="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
121
+ filename="dummypdf"
122
+ filetype="pdf"
123
+ >
124
+ </ezp-printing>
125
+ </body>
126
+ </html>
109
127
  ```
110
128
 
111
- ### Example with a custom button
129
+ ### Example with custom trigger
112
130
 
113
- Add the custom attribute to the **ezeep-printing** tag:
131
+ If you want to bind the printing process to a custom html element, you can use this example:
114
132
 
115
- **component.html**
116
133
  ```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>
134
+ <!DOCTYPE html>
135
+ <html dir="ltr" lang="en">
136
+ <head>
137
+ <meta charset="utf-8" />
138
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
139
+ <script type="module" src="https://cdn.ezeep.com/ezeep-js/ezeep.esm.js"></script>
140
+ <script nomodule src="https://cdn.ezeep.com/ezeep-js/ezeep.js"></script>
141
+ <title>ezeep-js</title>
142
+ <style>
143
+ .customButton {
144
+ background-color: DodgerBlue;
145
+ border: none;
146
+ border-radius: 6px;
147
+ color: white;
148
+ padding: 12px 16px;
149
+ font-size: 16px;
150
+ cursor: pointer;
151
+ }
152
+
153
+ .customButton:hover {
154
+ background-color: RoyalBlue;
155
+ }
156
+ </style>
157
+ </head>
158
+ <body>
159
+ <ezp-printing
160
+ clientid="your-own-client-id"
161
+ redirecturi="https://your-site.com/"
162
+ trigger="custom"
163
+ filename="dummypdf"
164
+ fileurl="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
165
+ filetype="pdf"
166
+ >
167
+ <button class="customButton">My custom styled print button</button>
168
+ </ezp-printing>
169
+ <script>
170
+ const ezpPrinting = document.querySelector('ezp-printing')
171
+ const button = document.querySelector('button')
172
+
173
+ button.onclick = async () => await ezpPrinting.open()
174
+ </script>
175
+ </body>
176
+ </html>
177
+ ```
178
+
179
+ ### Example with file trigger (Drag&Drop)
180
+
181
+ ```html
182
+ <!DOCTYPE html>
183
+ <html dir="ltr" lang="en">
184
+ <head>
185
+ <meta charset="utf-8" />
186
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
187
+ <script type="module" src="https://cdn.ezeep.com/ezeep-js/ezeep.esm.js"></script>
188
+ <script nomodule src="https://cdn.ezeep.com/ezeep-js/ezeep.js"></script>
189
+ <title>ezeep-js</title>
190
+ <style>
191
+ /*
192
+ you can set the width and height of the upload field, for example like this:
193
+ (if no width or height is set, it defaults to "auto")
194
+ */
195
+ :root {
196
+ --ezp-upload-width: calc(80vw);
197
+ --ezp-upload-height: calc(80vh);
198
+ }
199
+ </style>
200
+ </head>
201
+ <body>
202
+ <ezp-printing
203
+ clientid="oWuvEAndErO3kKCqzaWBOAs2PhOuAbD7MZYWQ9yJ"
204
+ redirecturi="https://develop.dev.azdev.ezeep.com:3333"
205
+ trigger="file"
206
+ theme="blue"
207
+ appearance="system"
208
+ >
209
+ </ezp-printing>
210
+ </body>
211
+ </html>
127
212
  ```
128
- Call the **open** function on the element:
129
213
 
130
214
  **component.ts**
131
215
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezeep/ngx-ezeep-js",
3
- "version": "1.0.164",
3
+ "version": "1.0.167",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.0",
6
6
  "@angular/core": "^12.2.0"