Skip to content

Commit eb7f593

Browse files
kemister85Farzad Hayat
andauthored
DOC-2591: Improve documentation for importword, exportpdf and exportword for Cloud. (#3535)
* DOC-2591: Improve documentation for importword, exportpdf and exportword to support Cloud. * Update modules/ROOT/pages/exportpdf.adoc Co-authored-by: Farzad Hayat <[email protected]> * Update modules/ROOT/pages/exportword.adoc Co-authored-by: Farzad Hayat <[email protected]> * Update modules/ROOT/pages/importword.adoc Co-authored-by: Farzad Hayat <[email protected]> * DOC-2591: Update exportpdf_converter_options value. * DOC-2591: File name changes for importword. * DOC-2591: remove second forward slash from pricing admin urls. --------- Co-authored-by: Farzad Hayat <[email protected]>
1 parent debe7d9 commit eb7f593

20 files changed

+449
-274
lines changed

modules/ROOT/pages/exportpdf.adoc

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Export to PDF plugin
1+
= {pluginname} plugin
22
:navtitle: Export to PDF
33
:description: The Export to PDF feature provides the ability to generate a PDF file directly from the editor.
44
:description_short: Generate a PDF file directly from the editor.
@@ -18,7 +18,7 @@ The {pluginname} feature collects the HTML generated with the `tinymce.editor.ge
1818

1919
liveDemo::exportpdf[]
2020

21-
== Basic setup
21+
== Basic setup using the {companyname} Cloud service
2222

2323
To add the {pluginname} plugin to the editor, add `{plugincode}` to the `plugins` option in the editor configuration.
2424

@@ -30,15 +30,47 @@ tinymce.init({
3030
selector: 'textarea',
3131
plugins: 'exportpdf',
3232
toolbar: 'exportpdf',
33-
exportpdf_service_url: '<service url>'
3433
});
3534
----
3635

36+
[IMPORTANT]
37+
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:
38+
39+
* xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[Export to PDF with JWT authentication (Nodejs)].
40+
* xref:export-to-pdf-with-jwt-authentication-php.adoc[Export to PDF with JWT authentication (PHP)].
41+
42+
== Basic setup using the self-hosted service
43+
44+
To use the self-hosted version of the {pluginname} plugin, you need to set the `exportpdf_service_url` option to the URL of the service.
45+
46+
For example:
47+
48+
[source,js]
49+
----
50+
tinymce.init({
51+
selector: 'textarea',
52+
plugins: 'exportpdf',
53+
toolbar: 'exportpdf',
54+
exportpdf_service_url: 'http://localhost:8080/' // Update with the URL of the service you are using such as 'http://myserver.com/'
55+
});
56+
----
57+
58+
[IMPORTANT]
59+
====
60+
The `exportpdf_service_url` option automatically appends `/v1/convert` to the URL provided, so only the base URL is required. For example, if the service is hosted at `http://localhost:8080/v1/convert`, the `exportpdf_service_url` option should be set to `http://localhost:8080/`. When using in production, ensure that `exportpdf_service_url` is updated to the production URL such as `https://myserver.com/`.
61+
====
62+
3763
== Options
3864

3965
The following configuration options affect the behavior of the {pluginname} plugin.
4066

41-
include::partial$configuration/{plugincode}.adoc[leveloffset=+1]
67+
include::partial$configuration/exportpdf_service_url.adoc[leveloffset=+1]
68+
69+
include::partial$configuration/exportpdf_token_provider.adoc[leveloffset=+1]
70+
71+
include::partial$configuration/exportpdf_converter_options.adoc[leveloffset=+1]
72+
73+
include::partial$configuration/exportpdf_converter_style.adoc[leveloffset=+1]
4274

4375
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
4476

modules/ROOT/pages/exportword.adoc

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Export to Word
1+
= {pluginname} plugin
22
:navtitle: exportword
33
:description: The export to Word feature lets you generate a .docx file directly from the editor.
44
:description_short: Generate a .docx file directly from the editor.
@@ -24,7 +24,7 @@ liveDemo::exportword[]
2424
* xref:introduction-to-mediaembed.adoc[Enhanced Media Embed] will not be included in the exported document, resulting in a console.error _"The Export to Word plugin requires the `exportword_service_url` to be configured"_.
2525
====
2626

27-
== Basic setup
27+
== Basic setup using the {companyname} Cloud service
2828

2929
To add the {pluginname} plugin to the editor, add `{plugincode}` to the `plugins` option in the editor configuration.
3030

@@ -36,24 +36,52 @@ tinymce.init({
3636
selector: 'textarea',
3737
plugins: 'exportword',
3838
toolbar: 'exportword',
39-
exportword_service_url: 'http://localhost:8080/' // update to your own self-hosted service URL
4039
});
4140
----
4241

4342
[IMPORTANT]
44-
The `exportword_service_url` option automatically appends `/v2/convert/html-docx` to the URL provided, so only the base URL is required. For example, if the service is hosted at `http://localhost:8080/v2/convert/html-docx`, the `exportword_service_url` option should be set to `http://localhost:8080/`.
43+
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:
44+
45+
* xref:export-to-word-with-jwt-authentication-nodejs.adoc[Export to Word with JWT authentication].
46+
* xref:export-to-word-with-jwt-authentication-php.adoc[Export to Word with JWT authentication].
47+
48+
== Basic setup using the self-hosted service
49+
50+
To use the self-hosted version of the {pluginname} plugin, you need to set the `exportword_service_url` option to the URL of the service.
51+
52+
For example:
53+
[source,js]
54+
----
55+
tinymce.init({
56+
selector: 'textarea',
57+
plugins: 'exportword',
58+
toolbar: 'exportword',
59+
exportword_service_url: 'http://localhost:8080/' // Update with the URL of the service you are using such as 'http://myserver.com/'
60+
});
61+
----
62+
63+
[IMPORTANT]
64+
====
65+
The `exportword_service_url` option automatically appends `/v2/convert/html-docx` to the URL provided, so only the base URL is required. For example, if the service is hosted at `http://localhost:8080/v2/convert/html-docx`, the `exportword_service_url` option should be set to `http://localhost:8080/`. When using in production, ensure that `exportword_service_url` is updated to the production URL such as `https://myserver.com/`.
66+
====
4567

4668
== Options
4769

4870
The following configuration options affect the behavior of the {pluginname} plugin.
4971

50-
include::partial$configuration/{plugincode}.adoc[leveloffset=+1]
72+
include::partial$configuration/exportword_service_url.adoc[leveloffset=+1]
73+
74+
include::partial$configuration/exportword_token_provider.adoc[leveloffset=+1]
75+
76+
include::partial$configuration/exportword_converter_options.adoc[leveloffset=+1]
77+
78+
include::partial$configuration/exportword_converter_style.adoc[leveloffset=+1]
5179

5280
== Commands
5381

5482
The {pluginname} plugin provides the following {productname} commands.
5583

56-
include::partial$commands/{plugincode}-cmds.adoc[][leveloffset=+1]
84+
include::partial$commands/exportword-cmds.adoc[][leveloffset=+1]
5785

5886
== API Reference
5987

modules/ROOT/pages/importword.adoc

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
= Import from Word plugin
2+
= {pluginname} plugin
33
:navtitle: Import from Word
44
:description: Provides a way to import .docx (Word documents) or .dotx (Word templates) files into the editor.
55
:description_short: Import .docx or .dotx files into the editor.
@@ -19,7 +19,7 @@ The {pluginname} plugin lets you import `.docx` (Word document) or `.dotx` (Word
1919

2020
liveDemo::importword[]
2121

22-
== Basic setup
22+
== Basic setup using the {companyname} Cloud service
2323

2424
To add the {pluginname} plugin to the editor, add `{plugincode}` to the `plugins` option in the editor configuration.
2525

@@ -31,17 +31,45 @@ tinymce.init({
3131
selector: 'textarea',
3232
plugins: 'importword',
3333
toolbar: 'importword',
34-
importword_service_url: '<service_URL>'
3534
});
3635
----
3736

37+
[IMPORTANT]
38+
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:
39+
40+
* xref:import-to-word-with-jwt-authentication-nodejs.adoc[Import to Word with JWT authentication].
41+
* xref:import-to-word-with-jwt-authentication-php.adoc[Import to Word with JWT authentication].
42+
43+
== Basic setup using the self-hosted service
44+
45+
To use the self-hosted version of the {pluginname} plugin, you need to set the `importword_service_url` option to the URL of the service.
46+
47+
For example:
48+
49+
[source,js]
50+
----
51+
tinymce.init({
52+
selector: 'textarea',
53+
plugins: 'importword',
54+
toolbar: 'importword',
55+
importword_service_url: 'http://localhost:8080/' // Update with the URL of the service you are using such as 'http://myserver.com/'
56+
});
57+
----
58+
59+
[IMPORTANT]
60+
====
61+
The `importword_service_url` option automatically appends `/v2/convert/docx-html` to the URL provided, so only the base URL is required. For example, if the service is hosted at `http://localhost:8080/v2/convert/docx-html`, the `importword_service_url` option should be set to `http://localhost:8080/`. When using in production, ensure that the `importword_service_url` is updated to the production URL such as `https://myserver.com/`.
62+
====
63+
3864
== Options
3965

4066
The following configuration options affect the behavior of the {pluginname} plugin.
4167

42-
include::partial$configuration/{plugincode}-service-url.adoc[leveloffset=+1]
68+
include::partial$configuration/importword_service_url.adoc[leveloffset=+1]
69+
70+
include::partial$configuration/importword_token_provider.adoc[leveloffset=+1]
4371

44-
include::partial$configuration/{plugincode}-converter-options.adoc[leveloffset=+1]
72+
include::partial$configuration/importword_converter_options.adoc[leveloffset=+1]
4573

4674
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
4775

@@ -51,7 +79,7 @@ include::partial$misc/plugin-menu-item-id-boilerplate.adoc[]
5179

5280
The {pluginname} plugin provides the following {productname} commands.
5381

54-
include::partial$commands/{plugincode}-cmds.adoc[]
82+
include::partial$commands/importword-cmds.adoc[]
5583

5684
== API Reference
5785

modules/ROOT/partials/configuration/exportpdf.adoc

Lines changed: 0 additions & 97 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[[exportpdf-converter-options]]
2+
== `exportpdf_converter_options`
3+
4+
This option allows the editor to download a PDF document containing its content, along with the specified options defined in the `exportpdf_converter_options`.
5+
6+
**Type:** `+Object+`
7+
8+
[NOTE]
9+
As of {productname} 7.5.0, the `exportpdf_converter_options` setting now comes with a default value set to the following:
10+
11+
.**Default value:**
12+
[source,js]
13+
----
14+
{
15+
format: 'Letter',
16+
margin_top: '1in',
17+
margin_right: '1in',
18+
margin_bottom: '1in',
19+
margin_left: '1in'
20+
}
21+
----
22+
23+
=== Example: using `exportpdf_converter_options`
24+
25+
[source,js]
26+
----
27+
tinymce.init({
28+
selector: 'textarea',
29+
plugins: 'exportpdf',
30+
toolbar: 'exportpdf',
31+
exportpdf_service_url: '<service_url>', // required if using On-premises service
32+
exportpdf_converter_options: {
33+
header_html: '<p>HEADER</p>', // example
34+
header_and_footer_css: 'p { color: blue }', // example
35+
},
36+
})
37+
----
38+
39+
[NOTE]
40+
The `exportpdf_service_url` option must be configured for the {pluginname} plugin to work.
41+
42+
> For comprehensive details regarding the `exportpdf_converter_options`, please refer to the https://exportpdf.converter.tiny.cloud/docs[API documentation^] available for the {pluginname} Premium plugin.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[[exportpdf-converter-style]]
2+
== `exportpdf_converter_style`
3+
4+
The `exportpdf_converter_style` option allow for customization of the styles applied to the exported PDF document, providing flexibility in controlling its appearance.
5+
6+
*Type:* `+String+`
7+
8+
*Default value:* `''`
9+
10+
=== Example: using `exportpdf_converter_style`
11+
12+
[source,js]
13+
----
14+
tinymce.init({
15+
selector: 'textarea.tinymce',
16+
plugins: 'exportpdf',
17+
toolbar: 'exportpdf',
18+
exportpdf_service_url: '<service_URL>', // required if using On-premises service
19+
exportpdf_converter_options: { // required to support "exportpdf_converter_style"
20+
header: [
21+
{
22+
html: '<h1>First page header.</h1>', //example
23+
css: 'h1 { font-size: 30px; }', //example
24+
}
25+
],
26+
},
27+
exportpdf_converter_style: 'p { color: cyan !important }' // requires both "exportpdf_converter_style" and "exportpdf_service_url" to be set.
28+
});
29+
----

0 commit comments

Comments
 (0)