@ckeditor/ckeditor5-export-pdf 44.1.0 → 44.2.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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/build/export-pdf.js +2 -2
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +2 -2
- package/dist/index.js +2 -2
- package/dist/translations/af.d.ts +2 -2
- package/dist/translations/af.js +2 -2
- package/dist/translations/af.umd.js +2 -2
- package/dist/translations/ar.d.ts +2 -2
- package/dist/translations/ar.js +2 -2
- package/dist/translations/ar.umd.js +2 -2
- package/dist/translations/ast.d.ts +2 -2
- package/dist/translations/ast.js +2 -2
- package/dist/translations/ast.umd.js +2 -2
- package/dist/translations/az.d.ts +2 -2
- package/dist/translations/az.js +2 -2
- package/dist/translations/az.umd.js +2 -2
- package/dist/translations/bg.d.ts +2 -2
- package/dist/translations/bg.js +2 -2
- package/dist/translations/bg.umd.js +2 -2
- package/dist/translations/bn.d.ts +2 -2
- package/dist/translations/bn.js +2 -2
- package/dist/translations/bn.umd.js +2 -2
- package/dist/translations/bs.d.ts +2 -2
- package/dist/translations/bs.js +2 -2
- package/dist/translations/bs.umd.js +2 -2
- package/dist/translations/ca.d.ts +2 -2
- package/dist/translations/ca.js +2 -2
- package/dist/translations/ca.umd.js +2 -2
- package/dist/translations/cs.d.ts +2 -2
- package/dist/translations/cs.js +2 -2
- package/dist/translations/cs.umd.js +2 -2
- package/dist/translations/da.d.ts +2 -2
- package/dist/translations/da.js +2 -2
- package/dist/translations/da.umd.js +2 -2
- package/dist/translations/de-ch.d.ts +2 -2
- package/dist/translations/de-ch.js +2 -2
- package/dist/translations/de-ch.umd.js +2 -2
- package/dist/translations/de.d.ts +2 -2
- package/dist/translations/de.js +2 -2
- package/dist/translations/de.umd.js +2 -2
- package/dist/translations/el.d.ts +2 -2
- package/dist/translations/el.js +2 -2
- package/dist/translations/el.umd.js +2 -2
- package/dist/translations/en-au.d.ts +2 -2
- package/dist/translations/en-au.js +2 -2
- package/dist/translations/en-au.umd.js +2 -2
- package/dist/translations/en-gb.d.ts +2 -2
- package/dist/translations/en-gb.js +2 -2
- package/dist/translations/en-gb.umd.js +2 -2
- package/dist/translations/en.d.ts +2 -2
- package/dist/translations/en.js +2 -2
- package/dist/translations/en.umd.js +2 -2
- package/dist/translations/eo.d.ts +2 -2
- package/dist/translations/eo.js +2 -2
- package/dist/translations/eo.umd.js +2 -2
- package/dist/translations/es-co.d.ts +2 -2
- package/dist/translations/es-co.js +2 -2
- package/dist/translations/es-co.umd.js +2 -2
- package/dist/translations/es.d.ts +2 -2
- package/dist/translations/es.js +2 -2
- package/dist/translations/es.umd.js +2 -2
- package/dist/translations/et.d.ts +2 -2
- package/dist/translations/et.js +2 -2
- package/dist/translations/et.umd.js +2 -2
- package/dist/translations/eu.d.ts +2 -2
- package/dist/translations/eu.js +2 -2
- package/dist/translations/eu.umd.js +2 -2
- package/dist/translations/fa.d.ts +2 -2
- package/dist/translations/fa.js +2 -2
- package/dist/translations/fa.umd.js +2 -2
- package/dist/translations/fi.d.ts +2 -2
- package/dist/translations/fi.js +2 -2
- package/dist/translations/fi.umd.js +2 -2
- package/dist/translations/fr.d.ts +2 -2
- package/dist/translations/fr.js +2 -2
- package/dist/translations/fr.umd.js +2 -2
- package/dist/translations/gl.d.ts +2 -2
- package/dist/translations/gl.js +2 -2
- package/dist/translations/gl.umd.js +2 -2
- package/dist/translations/gu.d.ts +2 -2
- package/dist/translations/gu.js +2 -2
- package/dist/translations/gu.umd.js +2 -2
- package/dist/translations/he.d.ts +2 -2
- package/dist/translations/he.js +2 -2
- package/dist/translations/he.umd.js +2 -2
- package/dist/translations/hi.d.ts +2 -2
- package/dist/translations/hi.js +2 -2
- package/dist/translations/hi.umd.js +2 -2
- package/dist/translations/hr.d.ts +2 -2
- package/dist/translations/hr.js +2 -2
- package/dist/translations/hr.umd.js +2 -2
- package/dist/translations/hu.d.ts +2 -2
- package/dist/translations/hu.js +2 -2
- package/dist/translations/hu.umd.js +2 -2
- package/dist/translations/hy.d.ts +2 -2
- package/dist/translations/hy.js +2 -2
- package/dist/translations/hy.umd.js +2 -2
- package/dist/translations/id.d.ts +2 -2
- package/dist/translations/id.js +2 -2
- package/dist/translations/id.umd.js +2 -2
- package/dist/translations/it.d.ts +2 -2
- package/dist/translations/it.js +2 -2
- package/dist/translations/it.umd.js +2 -2
- package/dist/translations/ja.d.ts +2 -2
- package/dist/translations/ja.js +2 -2
- package/dist/translations/ja.umd.js +2 -2
- package/dist/translations/jv.d.ts +2 -2
- package/dist/translations/jv.js +2 -2
- package/dist/translations/jv.umd.js +2 -2
- package/dist/translations/kk.d.ts +2 -2
- package/dist/translations/kk.js +2 -2
- package/dist/translations/kk.umd.js +2 -2
- package/dist/translations/km.d.ts +2 -2
- package/dist/translations/km.js +2 -2
- package/dist/translations/km.umd.js +2 -2
- package/dist/translations/kn.d.ts +2 -2
- package/dist/translations/kn.js +2 -2
- package/dist/translations/kn.umd.js +2 -2
- package/dist/translations/ko.d.ts +2 -2
- package/dist/translations/ko.js +2 -2
- package/dist/translations/ko.umd.js +2 -2
- package/dist/translations/ku.d.ts +2 -2
- package/dist/translations/ku.js +2 -2
- package/dist/translations/ku.umd.js +2 -2
- package/dist/translations/lt.d.ts +2 -2
- package/dist/translations/lt.js +2 -2
- package/dist/translations/lt.umd.js +2 -2
- package/dist/translations/lv.d.ts +2 -2
- package/dist/translations/lv.js +2 -2
- package/dist/translations/lv.umd.js +2 -2
- package/dist/translations/ms.d.ts +2 -2
- package/dist/translations/ms.js +2 -2
- package/dist/translations/ms.umd.js +2 -2
- package/dist/translations/nb.d.ts +2 -2
- package/dist/translations/nb.js +2 -2
- package/dist/translations/nb.umd.js +2 -2
- package/dist/translations/ne.d.ts +2 -2
- package/dist/translations/ne.js +2 -2
- package/dist/translations/ne.umd.js +2 -2
- package/dist/translations/nl.d.ts +2 -2
- package/dist/translations/nl.js +2 -2
- package/dist/translations/nl.umd.js +2 -2
- package/dist/translations/no.d.ts +2 -2
- package/dist/translations/no.js +2 -2
- package/dist/translations/no.umd.js +2 -2
- package/dist/translations/oc.d.ts +2 -2
- package/dist/translations/oc.js +2 -2
- package/dist/translations/oc.umd.js +2 -2
- package/dist/translations/pl.d.ts +2 -2
- package/dist/translations/pl.js +2 -2
- package/dist/translations/pl.umd.js +2 -2
- package/dist/translations/pt-br.d.ts +2 -2
- package/dist/translations/pt-br.js +2 -2
- package/dist/translations/pt-br.umd.js +2 -2
- package/dist/translations/pt.d.ts +2 -2
- package/dist/translations/pt.js +2 -2
- package/dist/translations/pt.umd.js +2 -2
- package/dist/translations/ro.d.ts +2 -2
- package/dist/translations/ro.js +2 -2
- package/dist/translations/ro.umd.js +2 -2
- package/dist/translations/ru.d.ts +2 -2
- package/dist/translations/ru.js +2 -2
- package/dist/translations/ru.umd.js +2 -2
- package/dist/translations/si.d.ts +2 -2
- package/dist/translations/si.js +2 -2
- package/dist/translations/si.umd.js +2 -2
- package/dist/translations/sk.d.ts +2 -2
- package/dist/translations/sk.js +2 -2
- package/dist/translations/sk.umd.js +2 -2
- package/dist/translations/sl.d.ts +2 -2
- package/dist/translations/sl.js +2 -2
- package/dist/translations/sl.umd.js +2 -2
- package/dist/translations/sq.d.ts +2 -2
- package/dist/translations/sq.js +2 -2
- package/dist/translations/sq.umd.js +2 -2
- package/dist/translations/sr-latn.d.ts +2 -2
- package/dist/translations/sr-latn.js +2 -2
- package/dist/translations/sr-latn.umd.js +2 -2
- package/dist/translations/sr.d.ts +2 -2
- package/dist/translations/sr.js +2 -2
- package/dist/translations/sr.umd.js +2 -2
- package/dist/translations/sv.d.ts +2 -2
- package/dist/translations/sv.js +2 -2
- package/dist/translations/sv.umd.js +2 -2
- package/dist/translations/th.d.ts +2 -2
- package/dist/translations/th.js +2 -2
- package/dist/translations/th.umd.js +2 -2
- package/dist/translations/ti.d.ts +2 -2
- package/dist/translations/ti.js +2 -2
- package/dist/translations/ti.umd.js +2 -2
- package/dist/translations/tk.d.ts +2 -2
- package/dist/translations/tk.js +2 -2
- package/dist/translations/tk.umd.js +2 -2
- package/dist/translations/tr.d.ts +2 -2
- package/dist/translations/tr.js +2 -2
- package/dist/translations/tr.umd.js +2 -2
- package/dist/translations/tt.d.ts +2 -2
- package/dist/translations/tt.js +2 -2
- package/dist/translations/tt.umd.js +2 -2
- package/dist/translations/ug.d.ts +2 -2
- package/dist/translations/ug.js +2 -2
- package/dist/translations/ug.umd.js +2 -2
- package/dist/translations/uk.d.ts +2 -2
- package/dist/translations/uk.js +2 -2
- package/dist/translations/uk.umd.js +2 -2
- package/dist/translations/ur.d.ts +2 -2
- package/dist/translations/ur.js +2 -2
- package/dist/translations/ur.umd.js +2 -2
- package/dist/translations/uz.d.ts +2 -2
- package/dist/translations/uz.js +2 -2
- package/dist/translations/uz.umd.js +2 -2
- package/dist/translations/vi.d.ts +2 -2
- package/dist/translations/vi.js +2 -2
- package/dist/translations/vi.umd.js +2 -2
- package/dist/translations/zh-cn.d.ts +2 -2
- package/dist/translations/zh-cn.js +2 -2
- package/dist/translations/zh-cn.umd.js +2 -2
- package/dist/translations/zh.d.ts +2 -2
- package/dist/translations/zh.js +2 -2
- package/dist/translations/zh.umd.js +2 -2
- package/lang/translations/af.po +1 -1
- package/lang/translations/ar.po +1 -1
- package/lang/translations/ast.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/bs.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/eo.po +1 -1
- package/lang/translations/es-co.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/eu.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/gu.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/hy.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/kk.po +1 -1
- package/lang/translations/km.po +1 -1
- package/lang/translations/kn.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/oc.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/si.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sl.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/ti.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/tt.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +29 -4
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/exportpdf.d.ts +1 -1
- package/src/exportpdf.js +2 -2
- package/src/exportpdfcommand.d.ts +1 -1
- package/src/exportpdfcommand.js +2 -2
- package/src/exportpdfui.d.ts +1 -1
- package/src/exportpdfui.js +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -2
- package/src/utils/common-translations.d.ts +1 -1
- package/src/utils/common-translations.js +2 -2
- package/dist/augmentation.d.ts +0 -25
- package/dist/exportpdf.d.ts +0 -242
- package/dist/exportpdfcommand.d.ts +0 -43
- package/dist/exportpdfui.d.ts +0 -35
- package/dist/index.d.ts +0 -14
- package/dist/utils/common-translations.d.ts +0 -13
- package/dist/utils.d.ts +0 -14
- package/src/utils.d.ts +0 -10
- package/src/utils.js +0 -23
package/dist/exportpdf.d.ts
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module export-pdf/exportpdf
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
-
import { Notification } from 'ckeditor5/src/ui.js';
|
|
15
|
-
import type { InitializedToken, TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
|
|
16
|
-
import ExportPdfUI from './exportpdfui.js';
|
|
17
|
-
/**
|
|
18
|
-
* The export to PDF feature.
|
|
19
|
-
*
|
|
20
|
-
* It allows you to generate a PDF file directly from the editor content.
|
|
21
|
-
*
|
|
22
|
-
* For a detailed overview, check the {@glink features/converters/export-pdf export to PDF} feature documentation.
|
|
23
|
-
*/
|
|
24
|
-
export default class ExportPdf extends Plugin {
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
static get pluginName(): "ExportPdf";
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
static get isOfficialPlugin(): true;
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isPremiumPlugin(): true;
|
|
37
|
-
/**
|
|
38
|
-
* @inheritDoc
|
|
39
|
-
*/
|
|
40
|
-
static get requires(): readonly ["CloudServices", typeof Notification, typeof ExportPdfUI];
|
|
41
|
-
/**
|
|
42
|
-
* @inheritDoc
|
|
43
|
-
*/
|
|
44
|
-
init(): void;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The configuration of the export to PDF feature. It is used by the PDF export features from the `@ckeditor/ckeditor5-export-pdf` package.
|
|
48
|
-
*
|
|
49
|
-
* ```ts
|
|
50
|
-
* ClassicEditor
|
|
51
|
-
* .create( editorElement, {
|
|
52
|
-
* exportPdf: ... // Export to PDF feature options.
|
|
53
|
-
* } )
|
|
54
|
-
* .then( ... )
|
|
55
|
-
* .catch( ... );
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
59
|
-
*/
|
|
60
|
-
export interface ExportPdfConfig {
|
|
61
|
-
/**
|
|
62
|
-
* Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
|
|
63
|
-
*
|
|
64
|
-
* ```ts
|
|
65
|
-
* const exportPdfConfig = {
|
|
66
|
-
* stylesheets: [ './path/to/custom-style.css' ]
|
|
67
|
-
* }
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* **NOTE:** If `stylesheets` are not provided, the plugin will sent only
|
|
71
|
-
* {@glink getting-started/setup/css the default editor content styles}
|
|
72
|
-
* to the converter.
|
|
73
|
-
*
|
|
74
|
-
* **Default editor's content styles**:
|
|
75
|
-
* {@glink getting-started/setup/css The default editor content styles}
|
|
76
|
-
* are applied to the generated PDF thanks to the `'EDITOR_STYLES'` token, which is provided to the `stylesheets` by default.
|
|
77
|
-
* If you don't want them to be applied, you have to omit the token:
|
|
78
|
-
*
|
|
79
|
-
* **NOTE:** The `'EDITOR_STYLES'` string is only supported in legacy custom builds with webpack or DLLs.
|
|
80
|
-
* In other setups you always need to pass the stylesheets.
|
|
81
|
-
*
|
|
82
|
-
* ```ts
|
|
83
|
-
* const exportPdfConfig = {
|
|
84
|
-
* stylesheets: [ './path/to/custom-editor-styles.css' ]
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* **Web fonts:** If you want to {@glink features/converters/export-pdf#providing-web-font-styles use web fonts} in your PDF document,
|
|
89
|
-
* you should provide a path to the file containing the web font declaration before the `'EDITOR_STYLES'` token and other style sheets:
|
|
90
|
-
*
|
|
91
|
-
* ```ts
|
|
92
|
-
* const exportPdfConfig = {
|
|
93
|
-
* stylesheets: [
|
|
94
|
-
* './path/to/fonts.css'
|
|
95
|
-
* './path/to/editor-styles.css',
|
|
96
|
-
* ]
|
|
97
|
-
* }
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* **Web fonts and custom styling:** For more advanced styling, your configuration should look like this:
|
|
101
|
-
*
|
|
102
|
-
* ```ts
|
|
103
|
-
* const exportPdfConfig = {
|
|
104
|
-
* stylesheets: [
|
|
105
|
-
* './path/to/fonts.css',
|
|
106
|
-
* './path/to/editor-styles.css',
|
|
107
|
-
* './path/to/custom-styles.css'
|
|
108
|
-
* ]
|
|
109
|
-
* }
|
|
110
|
-
* ```
|
|
111
|
-
*
|
|
112
|
-
* @default `[ 'EDITOR_STYLES' ]`
|
|
113
|
-
*/
|
|
114
|
-
stylesheets?: Array<string>;
|
|
115
|
-
/**
|
|
116
|
-
* The name of the generated PDF file.
|
|
117
|
-
*
|
|
118
|
-
* ```ts
|
|
119
|
-
* // Static file name.
|
|
120
|
-
* const exportPdfConfig = {
|
|
121
|
-
* fileName: 'my-document.pdf'
|
|
122
|
-
* }
|
|
123
|
-
*
|
|
124
|
-
* // Dynamic file name.
|
|
125
|
-
* const exportPdfConfig = {
|
|
126
|
-
* fileName: () => {
|
|
127
|
-
* const articleTitle = document.querySelector( '#title' );
|
|
128
|
-
*
|
|
129
|
-
* return `${ articleTitle.value }.pdf`;
|
|
130
|
-
* }
|
|
131
|
-
* }
|
|
132
|
-
* ```
|
|
133
|
-
*
|
|
134
|
-
* **NOTE:** The file name must contain the `.pdf` extension.
|
|
135
|
-
* Otherwise your operating system or device may have trouble identifying the file type.
|
|
136
|
-
*
|
|
137
|
-
* @default 'document.pdf'
|
|
138
|
-
*/
|
|
139
|
-
fileName?: string | (() => string);
|
|
140
|
-
/**
|
|
141
|
-
* A URL to the HTML to PDF converter.
|
|
142
|
-
*
|
|
143
|
-
* ```ts
|
|
144
|
-
* const exportPdfConfig = {
|
|
145
|
-
* converterUrl: 'https://myconverter.com/v1/'
|
|
146
|
-
* }
|
|
147
|
-
* ```
|
|
148
|
-
*
|
|
149
|
-
* **NOTE:** The plugin uses the default HTML to PDF converter delivered by CKEditor Cloud Services.
|
|
150
|
-
* You can provide a URL to an on-premises converter instead.
|
|
151
|
-
*
|
|
152
|
-
* @default 'https://pdf-converter.cke-cs.com/v1/convert'
|
|
153
|
-
*/
|
|
154
|
-
converterUrl?: string;
|
|
155
|
-
/**
|
|
156
|
-
* The HTML to PDF converter options.
|
|
157
|
-
*
|
|
158
|
-
* **NOTE:** Configuring the plugin is not mandatory but it is highly recommended,
|
|
159
|
-
* especially if you want to get the most accurate results when generating the PDF file.
|
|
160
|
-
* To learn more, please check the [HTML to PDF converter configuration](https://pdf-converter.cke-cs.com/docs).
|
|
161
|
-
*
|
|
162
|
-
* ```ts
|
|
163
|
-
* const exportPdfConfig = {
|
|
164
|
-
* converterOptions: {
|
|
165
|
-
* ...
|
|
166
|
-
* }
|
|
167
|
-
* }
|
|
168
|
-
* ```
|
|
169
|
-
*
|
|
170
|
-
* @default `{
|
|
171
|
-
* format: 'A4',
|
|
172
|
-
* margin_top: '0',
|
|
173
|
-
* margin_bottom: '0',
|
|
174
|
-
* margin_right: '0',
|
|
175
|
-
* margin_left: '0',
|
|
176
|
-
* page_orientation: 'portrait',
|
|
177
|
-
* header_html: undefined,
|
|
178
|
-
* footer_html: undefined,
|
|
179
|
-
* header_and_footer_css: undefined,
|
|
180
|
-
* wait_for_network: true,
|
|
181
|
-
* wait_time: 0
|
|
182
|
-
* }`
|
|
183
|
-
*/
|
|
184
|
-
converterOptions?: ExportPdfConverterOptions;
|
|
185
|
-
/**
|
|
186
|
-
* A function to gather the HTML to be converted to PDF.
|
|
187
|
-
*
|
|
188
|
-
* **NOTE:** This option may be useful when the editor does not have `getData()` method,
|
|
189
|
-
* or if the HTML to be converted should be different than the edited one.
|
|
190
|
-
*
|
|
191
|
-
* ```ts
|
|
192
|
-
* const exportPdfConfig = {
|
|
193
|
-
* dataCallback: ( editor: Editor ) => {
|
|
194
|
-
* return `
|
|
195
|
-
* <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
|
|
196
|
-
* <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
|
|
197
|
-
* `;
|
|
198
|
-
* }
|
|
199
|
-
* }
|
|
200
|
-
* ```
|
|
201
|
-
*
|
|
202
|
-
* @default `( editor: Editor ) => editor.getData()`
|
|
203
|
-
*/
|
|
204
|
-
dataCallback?: (editor: Editor) => string;
|
|
205
|
-
/**
|
|
206
|
-
* A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
|
|
207
|
-
* the export to PDF feature.
|
|
208
|
-
*
|
|
209
|
-
* **Note:** The token can be disabled with the `false` value provided.
|
|
210
|
-
*
|
|
211
|
-
* See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
|
|
212
|
-
*/
|
|
213
|
-
tokenUrl?: TokenUrl | false;
|
|
214
|
-
/**
|
|
215
|
-
* The authentication token.
|
|
216
|
-
*
|
|
217
|
-
* See: {@link module:cloud-services/cloudservices~CloudServices#token}
|
|
218
|
-
*/
|
|
219
|
-
token?: InitializedToken;
|
|
220
|
-
/**
|
|
221
|
-
* The application unique identifier.
|
|
222
|
-
*/
|
|
223
|
-
appID?: string;
|
|
224
|
-
}
|
|
225
|
-
export type ExportPdfConverterOptions = {
|
|
226
|
-
format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | string & Record<never, never>;
|
|
227
|
-
margin_top?: string;
|
|
228
|
-
margin_bottom?: string;
|
|
229
|
-
margin_right?: string;
|
|
230
|
-
margin_left?: string;
|
|
231
|
-
header_html?: string;
|
|
232
|
-
footer_html?: string;
|
|
233
|
-
header_and_footer_css?: string;
|
|
234
|
-
page_orientation?: 'portrait' | 'landscape' | string & Record<never, never>;
|
|
235
|
-
wait_for_network?: boolean;
|
|
236
|
-
wait_time?: number;
|
|
237
|
-
merge_fields?: {
|
|
238
|
-
prefix: string;
|
|
239
|
-
suffix: string;
|
|
240
|
-
data: Record<string, string>;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module export-pdf/exportpdfcommand
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
-
import { type ExportPdfConfig } from './exportpdf.js';
|
|
15
|
-
/**
|
|
16
|
-
* The export to PDF command.
|
|
17
|
-
*
|
|
18
|
-
* It takes the editor's HTML and CSS rules from the document and sends them to the HTML to PDF converter.
|
|
19
|
-
* After processing, the converter will send back a PDF file for download.
|
|
20
|
-
*/
|
|
21
|
-
export default class ExportPdfCommand extends Command {
|
|
22
|
-
/**
|
|
23
|
-
* A command state that indicates if the command is currently executing.
|
|
24
|
-
*
|
|
25
|
-
* @observable
|
|
26
|
-
*/
|
|
27
|
-
isBusy: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
constructor(editor: Editor);
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
refresh(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Executes the command.
|
|
38
|
-
*
|
|
39
|
-
* @fires execute
|
|
40
|
-
* @param options Options for the executed command.
|
|
41
|
-
*/
|
|
42
|
-
execute(options?: ExportPdfConfig): Promise<void>;
|
|
43
|
-
}
|
package/dist/exportpdfui.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module export-pdf/exportpdfui
|
|
11
|
-
*/
|
|
12
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
-
/**
|
|
14
|
-
* The export to PDF UI feature.
|
|
15
|
-
*
|
|
16
|
-
* It introduces 'Export to PDF' button in toolbar and menu bar.
|
|
17
|
-
*/
|
|
18
|
-
export default class ExportPdfUI extends Plugin {
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
static get pluginName(): "ExportPdfUI";
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get isOfficialPlugin(): true;
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get isPremiumPlugin(): true;
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
init(): void;
|
|
35
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module export-pdf
|
|
11
|
-
*/
|
|
12
|
-
export { default as ExportPdf, type ExportPdfConfig } from './exportpdf.js';
|
|
13
|
-
export type { default as ExportPdfCommand } from './exportpdfcommand.js';
|
|
14
|
-
import './augmentation.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module export-pdf/utils/common-translations
|
|
11
|
-
*/
|
|
12
|
-
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
13
|
-
export declare function getTranslation(locale: Locale, id: string): string;
|
package/dist/utils.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* A helper function for getting concatenated CSS rules from external stylesheets and the editor.
|
|
11
|
-
*
|
|
12
|
-
* @param stylesheets An array of stylesheet paths delivered by the user through the plugin configuration.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getStyles(stylesheets?: Array<string>): Promise<string>;
|
package/src/utils.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
/**
|
|
6
|
-
* A helper function for getting concatenated CSS rules from external stylesheets and the editor.
|
|
7
|
-
*
|
|
8
|
-
* @param stylesheets An array of stylesheet paths delivered by the user through the plugin configuration.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getStyles(stylesheets?: Array<string>): Promise<string>;
|
package/src/utils.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* +---------------------------------------------------------------------------------+
|
|
8
|
-
* | |
|
|
9
|
-
* | Hello stranger! |
|
|
10
|
-
* | |
|
|
11
|
-
* | |
|
|
12
|
-
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
-
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
-
* | are forbidden and will result in legal consequences. |
|
|
15
|
-
* | |
|
|
16
|
-
* | |
|
|
17
|
-
* +---------------------------------------------------------------------------------+
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
(function(_0x103e2a,_0x23ddb7){const _0x2e85c8=_0xe62f,_0x24b83e=_0x103e2a();while(!![]){try{const _0x54b640=parseInt(_0x2e85c8(0x1d1))/0x1*(parseInt(_0x2e85c8(0x1c9))/0x2)+-parseInt(_0x2e85c8(0x1cf))/0x3*(-parseInt(_0x2e85c8(0x1d2))/0x4)+parseInt(_0x2e85c8(0x1c1))/0x5+-parseInt(_0x2e85c8(0x1c4))/0x6*(parseInt(_0x2e85c8(0x1b7))/0x7)+-parseInt(_0x2e85c8(0x1bb))/0x8+-parseInt(_0x2e85c8(0x1c5))/0x9*(-parseInt(_0x2e85c8(0x1be))/0xa)+-parseInt(_0x2e85c8(0x1c2))/0xb;if(_0x54b640===_0x23ddb7)break;else _0x24b83e['push'](_0x24b83e['shift']());}catch(_0x2a97ac){_0x24b83e['push'](_0x24b83e['shift']());}}}(_0x3e51,0x565b1));function _0xe62f(_0x1b74ca,_0x3c1634){const _0x3e516d=_0x3e51();return _0xe62f=function(_0xe62f6f,_0x227be1){_0xe62f6f=_0xe62f6f-0x1b7;let _0x53017e=_0x3e516d[_0xe62f6f];return _0x53017e;},_0xe62f(_0x1b74ca,_0x3c1634);}export function getStyles(_0x14a07f){const _0x167253=_0xe62f;if(!_0x14a07f)return new Promise(_0x5dbe3c=>_0x5dbe3c(''));const _0x1b3e44=[];for(const _0x358756 of _0x14a07f)_0x167253(0x1ba)!==_0x358756?_0x1b3e44[_0x167253(0x1bc)](window[_0x167253(0x1d0)](_0x358756)[_0x167253(0x1cc)](_0xc87098=>_0xc87098[_0x167253(0x1bd)]())):_0x1b3e44[_0x167253(0x1bc)](a());return Promise[_0x167253(0x1ca)](_0x1b3e44)[_0x167253(0x1cc)](_0xb76b9f=>_0xb76b9f[_0x167253(0x1bf)]('\x20')[_0x167253(0x1c8)]());}function _0x3e51(){const _0x12da06=['indexOf','556475GxMORs','892837uQXYIP','cssText','116826FUgZoV','270999ZsbpAG','from','.ck-content','trim','541238sUNwJe','all','The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.','then','ownerNode','hasAttribute','111CeBrgj','fetch','1iITlJG','57356UsIbwi',':root','cssRules','data-cke','styleSheets','63JXAEHP','length','warn','EDITOR_STYLES','2659592vFPSwf','push','text','10sgBooQ','join'];_0x3e51=function(){return _0x12da06;};return _0x3e51();}function a(){const _0xd3df74=_0xe62f,_0x5670ff=[],_0x8f35d0=[];for(const _0x4b835e of Array[_0xd3df74(0x1c6)](document[_0xd3df74(0x1d6)])){if(_0x4b835e[_0xd3df74(0x1cd)][_0xd3df74(0x1ce)](_0xd3df74(0x1d5))){for(const _0x4aef92 of Array[_0xd3df74(0x1c6)](_0x4b835e[_0xd3df74(0x1d4)]))-0x1!==_0x4aef92[_0xd3df74(0x1c3)][_0xd3df74(0x1c0)](_0xd3df74(0x1c7))?_0x5670ff[_0xd3df74(0x1bc)](_0x4aef92[_0xd3df74(0x1c3)]):-0x1!==_0x4aef92[_0xd3df74(0x1c3)][_0xd3df74(0x1c0)](_0xd3df74(0x1d3))&&_0x8f35d0[_0xd3df74(0x1bc)](_0x4aef92[_0xd3df74(0x1c3)]);}}return _0x5670ff[_0xd3df74(0x1b8)]||console[_0xd3df74(0x1b9)](_0xd3df74(0x1cb)),[..._0x8f35d0,..._0x5670ff][_0xd3df74(0x1bf)]('\x20')[_0xd3df74(0x1c8)]();}
|