Contribute to this guideReport an issue

guidePasting Content from LibreOffice

This feature is provided through the Paste from LibreOffice plugin that is included in the Standard and Full presets available from the official CKEditor 4 Download site. You can also add it to your custom build with online builder.

The Paste from LibreOffice plugin allows you to paste content from LibreOffice Writer and maintain original content structure and formatting.

When enabled, it automatically detects LibreOffice Writer content and transforms its structure and formatting to clean HTML.

# Supported Features

Paste from LibreOffice retains the following formatting:

  • Text formatting
    • Text and background colors
    • Font family, style and size
    • Basic formatting (bold, italic, underline)
    • Font effects (strikethrough, superscript, subscript)
    • Heading levels
    • Text alignment
  • Lists
    • Numbered and bulleted lists
    • Multilevel lists
    • Different numbering formats (Roman, decimal, alphanumeric)
    • Custom start number (e.g. you can start the list from number 4)
  • Tables
    • Borders and shading
    • Cell size (width and height)
    • Cell alignment
  • Images

The Paste from LibreOffice plugin maintains most of LibreOffice Writer text formatting features with some exceptions related to advanced styling, customizations, or styles that are not supported by HTML.

The plugin is supported only in Google Chrome, Mozilla Firefox and Microsoft Edge browsers. In Safari and Internet Explorer it is not possible to detect if the content is copied from LibreOffice Writer. However, even without the official support for the plugin, most of the formatting should be preserved correctly upon pasting in these browsers.

# Sample

The following sample content from a LibreOffice Writer document:

A sample LibreOffice Writer document.

will look like below after pasting to CKEditor 4 with the Paste from LibreOffice plugin enabled:

LibreOffice Writer content pasted into CKEditor 4 WYSIWYG editor.

Here is another sample with some more complicated formatting and styling as well as an image:

A sample LibreOffice Writer document with complex formatting and image.

It will look like this after pasting into CKEditor 4:

Complex LibreOffice Writer content pasted into CKEditor 4 WYSIWYG editor.

# Filters

HTML exposed by LibreOffice Writer does not fully comply to rules of valid and semantic HTML. Therefore, a separate filter had to be created to normalize this content. It is implemented in the Paste from LibreOffice plugin.

# Paste from LibreOffice Demo

See the working “Pasting content from LibreOffice” sample that showcases the Paste from LibreOffice plugin.

Refer to the following resources for more information about pasting content: