@ckeditor/ckeditor5-export-pdf 48.2.0 → 48.3.0-alpha.0
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/dist/augmentation.d.ts +19 -19
- package/dist/exportpdf.d.ts +304 -304
- package/dist/exportpdfcommand.d.ts +34 -34
- package/dist/exportpdfui.d.ts +26 -26
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/dist/utils/common-translations.d.ts +6 -6
- package/package.json +7 -7
package/dist/exportpdf.d.ts
CHANGED
|
@@ -1,322 +1,322 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { Plugin, type Editor } from
|
|
10
|
-
import { Notification } from
|
|
11
|
-
import { CloudServices, type InitializedToken, type TokenUrl } from
|
|
12
|
-
import { ExportPdfUI } from
|
|
6
|
+
* @module export-pdf/exportpdf
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { Notification } from "@ckeditor/ckeditor5-ui";
|
|
11
|
+
import { CloudServices, type InitializedToken, type TokenUrl } from "@ckeditor/ckeditor5-cloud-services";
|
|
12
|
+
import { ExportPdfUI } from "./exportpdfui.js";
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
* The export to PDF feature.
|
|
15
|
+
*
|
|
16
|
+
* It allows you to generate a PDF file directly from the editor content.
|
|
17
|
+
*
|
|
18
|
+
* For a detailed overview, check the {@glink features/converters/export-pdf export to PDF} feature documentation.
|
|
19
|
+
*/
|
|
20
20
|
export declare class ExportPdf extends Plugin {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get pluginName(): "ExportPdf";
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static override get isOfficialPlugin(): true;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static override get isPremiumPlugin(): true;
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get requires(): PluginDependenciesOf<[CloudServices, Notification, ExportPdfUI]>;
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
init(): void;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
* The configuration of the export to PDF feature. It is used by the PDF export features from the `@ckeditor/ckeditor5-export-pdf` package.
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* ClassicEditor
|
|
47
|
+
* .create( {
|
|
48
|
+
* exportPdf: ... // Export to PDF feature options.
|
|
49
|
+
* } )
|
|
50
|
+
* .then( ... )
|
|
51
|
+
* .catch( ... );
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
55
|
+
*/
|
|
56
56
|
export interface ExportPdfConfig {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
57
|
+
/**
|
|
58
|
+
* The version of the HTML to PDF converter API.
|
|
59
|
+
*
|
|
60
|
+
* @default '2'
|
|
61
|
+
*/
|
|
62
|
+
version?: 1 | 2;
|
|
63
|
+
/**
|
|
64
|
+
* Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
|
|
65
|
+
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* const exportPdfConfig = {
|
|
68
|
+
* stylesheets: [ './path/to/custom-style.css' ]
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* **NOTE:** If `stylesheets` are not provided, the plugin will sent only
|
|
73
|
+
* {@glink getting-started/setup/css the default editor content styles}
|
|
74
|
+
* to the converter.
|
|
75
|
+
*
|
|
76
|
+
* **Default editor's content styles**:
|
|
77
|
+
* {@glink getting-started/setup/css The default editor content styles}
|
|
78
|
+
* are applied to the generated PDF thanks to the `'EDITOR_STYLES'` token, which is provided to the `stylesheets` by default.
|
|
79
|
+
* If you don't want them to be applied, you have to omit the token:
|
|
80
|
+
*
|
|
81
|
+
* **NOTE:** The `'EDITOR_STYLES'` string is only supported in legacy custom builds with webpack or DLLs.
|
|
82
|
+
* In other setups you always need to pass the stylesheets.
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* const exportPdfConfig = {
|
|
86
|
+
* stylesheets: [ './path/to/custom-editor-styles.css' ]
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* **Web fonts:** If you want to {@glink features/converters/export-pdf#providing-web-font-styles use web fonts} in your PDF document,
|
|
91
|
+
* you should provide a path to the file containing the web font declaration before the `'EDITOR_STYLES'` token and other style sheets:
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* const exportPdfConfig = {
|
|
95
|
+
* stylesheets: [
|
|
96
|
+
* './path/to/fonts.css'
|
|
97
|
+
* './path/to/editor-styles.css',
|
|
98
|
+
* ]
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* **Web fonts and custom styling:** For more advanced styling, your configuration should look like this:
|
|
103
|
+
*
|
|
104
|
+
* ```ts
|
|
105
|
+
* const exportPdfConfig = {
|
|
106
|
+
* stylesheets: [
|
|
107
|
+
* './path/to/fonts.css',
|
|
108
|
+
* './path/to/editor-styles.css',
|
|
109
|
+
* './path/to/custom-styles.css'
|
|
110
|
+
* ]
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @default `[ 'EDITOR_STYLES' ]`
|
|
115
|
+
*/
|
|
116
|
+
stylesheets?: Array<string>;
|
|
117
|
+
/**
|
|
118
|
+
* The name of the generated PDF file.
|
|
119
|
+
*
|
|
120
|
+
* ```ts
|
|
121
|
+
* // Static file name.
|
|
122
|
+
* const exportPdfConfig = {
|
|
123
|
+
* fileName: 'my-document.pdf'
|
|
124
|
+
* }
|
|
125
|
+
*
|
|
126
|
+
* // Dynamic file name.
|
|
127
|
+
* const exportPdfConfig = {
|
|
128
|
+
* fileName: () => {
|
|
129
|
+
* const articleTitle = document.querySelector( '#title' );
|
|
130
|
+
*
|
|
131
|
+
* return `${ articleTitle.value }.pdf`;
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* **NOTE:** The file name must contain the `.pdf` extension.
|
|
137
|
+
* Otherwise your operating system or device may have trouble identifying the file type.
|
|
138
|
+
*
|
|
139
|
+
* @default 'document.pdf'
|
|
140
|
+
*/
|
|
141
|
+
fileName?: string | (() => string);
|
|
142
|
+
/**
|
|
143
|
+
* A URL to the HTML to PDF converter.
|
|
144
|
+
*
|
|
145
|
+
* ```ts
|
|
146
|
+
* const exportPdfConfig = {
|
|
147
|
+
* converterUrl: 'https://myconverter.com/v1/'
|
|
148
|
+
* }
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* **NOTE:** The plugin uses the default HTML to PDF converter delivered by CKEditor Cloud Services.
|
|
152
|
+
* You can provide a URL to an on-premises converter instead.
|
|
153
|
+
*
|
|
154
|
+
* @default 'https://pdf-converter.cke-cs.com/v2/convert/html-pdf'
|
|
155
|
+
*/
|
|
156
|
+
converterUrl?: string;
|
|
157
|
+
/**
|
|
158
|
+
* The HTML to PDF converter options.
|
|
159
|
+
*
|
|
160
|
+
* **NOTE:** Configuring the plugin is not mandatory but it is highly recommended,
|
|
161
|
+
* especially if you want to get the most accurate results when generating the PDF file.
|
|
162
|
+
* To learn more, please check the [HTML to PDF converter configuration](https://pdf-converter.cke-cs.com/v2/convert/docs).
|
|
163
|
+
*
|
|
164
|
+
* ```ts
|
|
165
|
+
* const exportPdfConfig = {
|
|
166
|
+
* converterOptions: {
|
|
167
|
+
* ...
|
|
168
|
+
* }
|
|
169
|
+
* }
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @default `{
|
|
173
|
+
* document: {
|
|
174
|
+
* size: 'A4',
|
|
175
|
+
* orientation: 'portrait',
|
|
176
|
+
* margins: {
|
|
177
|
+
* top: '0mm',
|
|
178
|
+
* bottom: '0mm',
|
|
179
|
+
* right: '0mm',
|
|
180
|
+
* left: '0mm'
|
|
181
|
+
* }
|
|
182
|
+
* },
|
|
183
|
+
* rendering: {
|
|
184
|
+
* wait_for_network: true,
|
|
185
|
+
* wait_time: 0
|
|
186
|
+
* }
|
|
187
|
+
* }`
|
|
188
|
+
*/
|
|
189
|
+
converterOptions?: ExportPdfConverterOptions | ExportPdfConverterOptionsV2;
|
|
190
|
+
/**
|
|
191
|
+
* A function to gather the HTML to be converted to PDF.
|
|
192
|
+
*
|
|
193
|
+
* **NOTE:** This option may be useful when the editor does not have `getData()` method,
|
|
194
|
+
* or if the HTML to be converted should be different than the edited one.
|
|
195
|
+
*
|
|
196
|
+
* ```ts
|
|
197
|
+
* const exportPdfConfig = {
|
|
198
|
+
* dataCallback: ( editor: Editor ) => {
|
|
199
|
+
* return `
|
|
200
|
+
* <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
|
|
201
|
+
* <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
|
|
202
|
+
* `;
|
|
203
|
+
* }
|
|
204
|
+
* }
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* @default `( editor: Editor ) => editor.getData()`
|
|
208
|
+
*/
|
|
209
|
+
dataCallback?: (editor: Editor) => string;
|
|
210
|
+
/**
|
|
211
|
+
* A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
|
|
212
|
+
* the export to PDF feature.
|
|
213
|
+
*
|
|
214
|
+
* **Note:** The token can be disabled with the `false` value provided.
|
|
215
|
+
*
|
|
216
|
+
* See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
|
|
217
|
+
*/
|
|
218
|
+
tokenUrl?: TokenUrl | false;
|
|
219
|
+
/**
|
|
220
|
+
* The authentication token.
|
|
221
|
+
*
|
|
222
|
+
* See: {@link module:cloud-services/cloudservices~CloudServices#token}
|
|
223
|
+
*/
|
|
224
|
+
token?: InitializedToken;
|
|
225
|
+
/**
|
|
226
|
+
* The application unique identifier.
|
|
227
|
+
*/
|
|
228
|
+
appID?: string;
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
* The HTML to PDF converter options for V1 of the converter API.
|
|
232
|
+
*/
|
|
233
233
|
export type ExportPdfConverterOptions = {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
234
|
+
format?: ExportPdfPageFormat;
|
|
235
|
+
margin_top?: string;
|
|
236
|
+
margin_bottom?: string;
|
|
237
|
+
margin_right?: string;
|
|
238
|
+
margin_left?: string;
|
|
239
|
+
header_html?: string;
|
|
240
|
+
footer_html?: string;
|
|
241
|
+
header_and_footer_css?: string;
|
|
242
|
+
page_orientation?: "portrait" | "landscape" | string & Record<never, never>;
|
|
243
|
+
wait_for_network?: boolean;
|
|
244
|
+
wait_time?: number;
|
|
245
|
+
merge_fields?: {
|
|
246
|
+
prefix: string;
|
|
247
|
+
suffix: string;
|
|
248
|
+
data: Record<string, string>;
|
|
249
|
+
};
|
|
250
250
|
};
|
|
251
251
|
/**
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
export type ExportPdfPageFormat =
|
|
252
|
+
* Predefined page formats used in the HTML to PDF converter.
|
|
253
|
+
* Supported in both V1 and V2 APIs.
|
|
254
|
+
*/
|
|
255
|
+
export type ExportPdfPageFormat = "Letter" | "Legal" | "Tabloid" | "Ledger" | "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | string & Record<never, never>;
|
|
256
256
|
/**
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
* The HTML to PDF converter options for V2 of the converter API.
|
|
258
|
+
*/
|
|
259
259
|
export type ExportPdfConverterOptionsV2 = {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
260
|
+
document?: {
|
|
261
|
+
size?: ExportPdfPageFormat | {
|
|
262
|
+
height: string;
|
|
263
|
+
width: string;
|
|
264
|
+
};
|
|
265
|
+
orientation?: "portrait" | "landscape";
|
|
266
|
+
margins?: {
|
|
267
|
+
top?: string;
|
|
268
|
+
bottom?: string;
|
|
269
|
+
left?: string;
|
|
270
|
+
right?: string;
|
|
271
|
+
enable_mirror_margins?: boolean;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
headers?: {
|
|
275
|
+
default?: ExportPdfSectionDefinitionV2;
|
|
276
|
+
first?: ExportPdfSectionDefinitionV2;
|
|
277
|
+
odd?: ExportPdfSectionDefinitionV2;
|
|
278
|
+
even?: ExportPdfSectionDefinitionV2;
|
|
279
|
+
};
|
|
280
|
+
footers?: {
|
|
281
|
+
default?: ExportPdfSectionDefinitionV2;
|
|
282
|
+
first?: ExportPdfSectionDefinitionV2;
|
|
283
|
+
odd?: ExportPdfSectionDefinitionV2;
|
|
284
|
+
even?: ExportPdfSectionDefinitionV2;
|
|
285
|
+
};
|
|
286
|
+
rendering?: {
|
|
287
|
+
wait_for_selector?: string;
|
|
288
|
+
wait_for_network?: boolean;
|
|
289
|
+
wait_time?: number;
|
|
290
|
+
};
|
|
291
|
+
base_url?: string;
|
|
292
|
+
extra_http_headers?: Record<string, Record<string, string>>;
|
|
293
|
+
merge_fields?: {
|
|
294
|
+
prefix: string;
|
|
295
|
+
suffix: string;
|
|
296
|
+
data: Record<string, string>;
|
|
297
|
+
};
|
|
298
|
+
disable_compression?: boolean;
|
|
299
|
+
security?: {
|
|
300
|
+
owner_password: string;
|
|
301
|
+
};
|
|
302
|
+
signature?: {
|
|
303
|
+
certificate: string;
|
|
304
|
+
certificate_password: string;
|
|
305
|
+
reason?: string;
|
|
306
|
+
location?: string;
|
|
307
|
+
};
|
|
308
|
+
metadata?: {
|
|
309
|
+
title?: string;
|
|
310
|
+
author?: string;
|
|
311
|
+
subject?: string;
|
|
312
|
+
keywords?: Array<string>;
|
|
313
|
+
custom_fields?: Record<string, string>;
|
|
314
|
+
};
|
|
315
315
|
};
|
|
316
316
|
/**
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
* Definition of a section (header or footer) in V2 of the HTML to PDF converter.
|
|
318
|
+
*/
|
|
319
319
|
export type ExportPdfSectionDefinitionV2 = {
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
html: string;
|
|
321
|
+
css?: string;
|
|
322
322
|
};
|