@ezeep/ngx-ezeep-js 1.0.165 → 1.0.169
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 +122 -38
- 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
|
|
84
|
-
| --------------- |
|
|
85
|
-
| **clientid** | Your registered Client-ID (see above).
|
|
86
|
-
| **redirecturi** | Your registered Redirect Uri (see above).
|
|
87
|
-
| **
|
|
88
|
-
|
|
|
89
|
-
| filename | The name of the file that is printed.
|
|
90
|
-
| filetype | The type of the file that is printed.
|
|
91
|
-
| hidelogin | If set to true, no additional info popup is shown before the user authentication.
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
>
|
|
108
|
-
</
|
|
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
|
|
129
|
+
### Example with custom trigger
|
|
112
130
|
|
|
113
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
>
|
|
125
|
-
|
|
126
|
-
|
|
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
|