Skip to main content

PrintButton Plugin

The PrintButton plugin adds convenient print functionality to the On-Codemerge editor, allowing users to print the content directly from the editor interface.

on-CodeMerge

A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product. This intuitive tool for developers of all skill levels.


Result:

Preview:

Integration

Integrating the PrintButton plugin with the On-Codemerge editor is straightforward. Import and register it with EditorCore as follows:

Initialize and Register PrintButton
import EditorCore from 'on-codemerge';
import { PrintButton } from 'on-codemerge/printButton';

document.addEventListener('DOMContentLoaded', () => {
const appElement = document.getElementById('app');
if (appElement) {
const editor = new EditorCore(appElement);
editor.registerModule(new PrintButton());
}
});

Features

  • Direct Printing: Adds a 'Print' button to the toolbar for printing the content of the editor.
  • Easy Access: Provides quick and easy access to print the current document without additional steps.

How it Works

The plugin works by opening a new window and writing the editor's content into it for printing: