Important changes to Tiny Cloud pricing > Find out more

NOTE: TinyMCE 5 reached End of Support in April 2023. No more bug fixes, security updates, or new features will be introduced to TinyMCE 5. We recommend you upgrade to TinyMCE 6 or consider TinyMCE 5 Long Term Support (LTS) if you need more time.

Page Break plugin

Add a page break.

Contribute to this page
+ toolbar button + menu item

This plugin adds page break support and enables a user to insert page breaks in the editable area. This is useful where a CMS uses a special separator to break content into pages.

It also adds a toolbar button and a menu item Page break under the Insert menu dropdown.

Basic setup

tinymce.init({
  selector: 'textarea',  // change this value according to your html
  plugins: 'pagebreak',
  menubar: 'insert',
  toolbar: 'pagebreak'
});

Options

These settings affect the execution of the pagebreak plugin. They enable you to specify how the page break should be generated in the HTML source code and determine whether the page break element(s) should be wrapped in <p>tags</p>.

pagebreak_separator

Type: String

Default Value: "<!-- pagebreak -->"

Example: Using pagebreak_separator

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'pagebreak',
  menubar: 'insert',
  toolbar: 'pagebreak',
  pagebreak_separator: '<!-- my page break -->'
});

pagebreak_split_block

When enabled this option makes it easier to split block elements with a page break.

Type: Boolean

Default Value: false

Possible Values: true, false

Example: Using pagebreak_split_block

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'pagebreak',
  menubar: 'insert',
  toolbar: 'pagebreak',
  pagebreak_split_block: true
});

Toolbar buttons

The Page Break plugin provides the following toolbar buttons:

Toolbar button identifier Description
pagebreak Inserts a pagebreak into the editor.

These toolbar buttons can be added to the editor using:

Menu items

The Page Break plugin provides the following menu items:

Menu item identifier Default Menu Location Description
pagebreak Insert Inserts a pagebreak into the editor.

These menu items can be added to the editor using:

Commands

The Page Break plugin provides the following JavaScript command.

Command Description
mcePageBreak Inserts a virtual page break (<!-- pagebreak -->) at the cursor location or overwrites the current selection.

Example

tinymce.activeEditor.execCommand('mcePageBreak');

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.