Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions modules/ROOT/pages/8.7.0-release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,34 @@ The following premium plugin updates were released alongside {productname} {rele

// For information on the **<Premium plugin name 1>** plugin, see: xref:<plugincode>.adoc[<Premium plugin name 1>].

=== Export to PDF

The {productname} {release-version} release includes an accompanying release of the **Export to PDF** premium plugin.

**Export to PDF** includes the following addition.

[[exportpdf-getcontent-export-property]]
==== It is now possible to have the kind of `export` in getContent's events and nodeFilter.
// #TINYMCE-14323

The **Export to PDF** plugin now calls `tinymce.editor.getContent()` with an `export` property set to `pdf`. {productname} passes this property to the `GetContent` event and to serializer node filters, so an integrator can apply content filtering that targets a PDF export without affecting regular content retrieval.

For information on filtering content during an export, see: xref:exportpdf.adoc#export-specific-content-filtering[Export-specific content filtering]. For information on the **Export to PDF** plugin, see: xref:exportpdf.adoc[Export to PDF].

=== Export to Word

The {productname} {release-version} release includes an accompanying release of the **Export to Word** premium plugin.

**Export to Word** includes the following addition.

[[exportword-getcontent-export-property]]
==== It is now possible to have the kind of `export` in getContent's events and nodeFilter.
// #TINYMCE-14323

The **Export to Word** plugin now calls `tinymce.editor.getContent()` with an `export` property set to `word`. {productname} passes this property to the `GetContent` event and to serializer node filters, so an integrator can apply content filtering that targets a Word export without affecting regular content retrieval.

For information on filtering content during an export, see: xref:exportword.adoc#export-specific-content-filtering[Export-specific content filtering]. For information on the **Export to Word** plugin, see: xref:exportword.adoc[Export to Word].


[[improvements]]
== Improvements
Expand Down
3 changes: 3 additions & 0 deletions modules/ROOT/pages/exportpdf.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= {pluginname} plugin
:plugincode: exportpdf
:pluginname: Export to PDF
:export-type: pdf
:page-aliases: export.adoc
:pluginfilename: export-to-pdf
:navtitle: Export to PDF
Expand Down Expand Up @@ -81,6 +82,8 @@ The `exportpdf_service_url` option automatically appends `/v2/convert/html-pdf`

include::partial$misc/pagebreak-export-note.adoc[]

include::partial$misc/export-specific-content-filtering.adoc[]

== Options

The following configuration options affect the behavior of the {pluginname} plugin.
Expand Down
3 changes: 3 additions & 0 deletions modules/ROOT/pages/exportword.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= {pluginname} plugin
:plugincode: exportword
:pluginname: Export to Word
:export-type: word
:pluginfilename: export-to-word
:navtitle: {pluginname}
:description: The {pluginname} feature lets you generate a .docx (Microsoft Word document) file directly from the editor.
Expand Down Expand Up @@ -80,6 +81,8 @@ The `exportword_service_url` option automatically appends `/v2/convert/html-docx

include::partial$misc/pagebreak-export-note.adoc[]

include::partial$misc/export-specific-content-filtering.adoc[]

== Options

The following configuration options affect the behavior of the {pluginname} plugin.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[[export-specific-content-filtering]]
== Export-specific content filtering

To generate content for export, the {pluginname} plugin calls the `tinymce.editor.getContent()` method with an `export` property set to `{export-type}`. {productname} adds this `export` property to the data for the xref:events.adoc#editor-core-events[`+GetContent+` event] and for serializer node filters. A serializer node filter or a `GetContent` event handler can read the `export` property to filter content during a {pluginname} export only, without changing the result of a standard `tinymce.editor.getContent()` call.

The following serializer node filter removes `footer` elements during a {pluginname} export:

[source,js,subs="+attributes"]
----
editor.serializer.addNodeFilter('footer', (nodes, name, args) => {
if (args.export === '{export-type}') {
nodes.forEach((node) => node.remove());
}
});
----

A `GetContent` event handler can read the same `export` property:

[source,js,subs="+attributes"]
----
editor.on('GetContent', (e) => {
if (e.export === '{export-type}') {
e.content = removeFooterFromHtml(e.content);
}
});
----
Loading