0
votes

i have removed the print button from the CKEditor Toolbar... now i want the print button to be outside the CKEditor in another div tag that is beside the CKEditor.... and i want the print button to have the button image that is used in CKEditor print button... the config.js code for the buttons :

config.toolbar = [

    { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'PasteText', 'Undo', 'Redo' ] },
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Scayt' ] },
    { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
        { name: 'styles', items: [ 'Font' ] },
        { name: 'styles', items: [ 'FontSize' ] },

        { name: 'links', items: [  ] },

    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },

    { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [  ] }, //Print , Templates

    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock',  'BidiLtr', 'BidiRtl', 'language' ] },
    { name: 'insert', items: [ 'Image', 'Table', 'PageBreak' ] },

    { name: 'styles', items: [ 'Styles'] },
    { name: 'styles', items: [ 'Format'] },



];

how can i do the ones i stated above...?? any help would be appreciated... thanks in advance.. :)

1
Check This.... [How to Trigger exec ](stackoverflow.com/questions/18830715/…) - Mari Selvan

1 Answers

3
votes

You can reference the print command directly. Try HTML and Javascript like this

<div onclick="ckePrint()">Click to print</div>
<script type="text/javascript">
    function ckePrint() {
        // Replace "editor1" with your editor name
        var i = CKEDITOR.instances.editor1;

         // Edited as per the comment by Reinmar
        i.editor.execCommand( 'print' );
    }
</script>