(function (factory) {
  /* global define */
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['jquery'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // Node/CommonJS
    module.exports = factory(require('jquery'));
  } else {
    // Browser globals
    factory(window.jQuery);
  }
}(function ($) {
  // Extends lang for print plugin.
  $.extend(true, $.summernote.lang, {
    'en-US': {
      print: {
        print: 'Print'
      }
    },
    'ko-KR': {
      print: {
        print: '인쇄'
      }
    },
    'pt-BR': {
      print: {
        print: 'Imprimir'
      }
    }
  });

  // Extends plugins for print plugin.
  $.extend($.summernote.plugins, {
    /**
     * @param {Object} context - context object has status of editor.
     */
    'print': function (context) {
      var self = this;

      // ui has renders to build ui elements.
      //  - you can create a button with `ui.button`
      var ui = $.summernote.ui;
      var $editor = context.layoutInfo.editor;
      var options = context.options;
      var lang = options.langInfo;

      // add print button
      context.memo('button.print', function () {
        // create button
        var button = ui.button({
          contents: '<i class="fa fa-print"/> ' + lang.print.print,
          tooltip: lang.print.print,
          click: function () {
            self.$printframe.contents().find('body').html(context.invoke('code'));
            setTimeout(function () {
              window.frames.summernotePrintFrame.window.focus();
              window.frames.summernotePrintFrame.window.print();
            }, 250);
          }
        });
        // create jQuery object from button instance.
        var $print = button.render();
        return $print;
      });

      this.initialize = function () {
        var $container = options.dialogsInBody ? $(document.body) : $editor;

        this.$printframe = $(
          '<iframe name="summernotePrintFrame"' +
          'width="0" height="0" frameborder="0" src="about:blank" style="visibility:hidden">' +
          '</iframe>');
        this.$printframe.appendTo($container.parent());

        var $head = this.$printframe.contents().find('head');
        if (options.print && options.print.stylesheetUrl) {
          // Use dedicated styles
          var css = document.createElement('link');
          css.href = options.print.stylesheetUrl;
          css.rel = 'stylesheet';
          css.type = 'text/css';
          $head.append(css);
        } else {
          // Inherit styles from document
          $('style, link[rel=stylesheet]', document).each(function () {
            $head.append($(this).clone());
          });
        }
      };

      this.destroy = function () {
        this.$printframe.remove();
        this.$printframe = null;
      };
    }
  });
}));

@@ -1144,827 +1144,65 @@
     
-// add print button%0A      context.memo('button.print', function () %7B%0A        // create button%0A        var button = ui.button(%7B%0A          contents: '%3Ci class=%22fa fa-print%22/%3E ' + lang.print.print,%0A          tooltip: lang.print.print,%0A          click: function () %7B%0A            self.$printframe.contents().find('body').html(context.invoke('code'));%0A            setTimeout(function () %7B%0A              window.frames.summernotePrintFrame.window.focus();%0A              window.frames.summernotePrintFrame.window.print();%0A            %7D, 250);%0A          %7D%0A        %7D);%0A        // create jQuery object from button instance.%0A        var $print = button.render();%0A        return $print;%0A      %7D);%0A%0A      this.initialize = function () %7B%0A        var $container = options.dialogsInBody ? $(document.body) : $editor;%0A%0A        this.$print
+var getPrintframe = function ($container) %7B%0A        var $
 fram
@@ -1382,35 +1382,25 @@
 ');%0A        
-this.$print
+$
 frame.append
@@ -1403,24 +1403,21 @@
 pendTo($
-containe
+edito
 r.parent
@@ -1442,27 +1442,17 @@
 $head = 
-this.$print
+$
 frame.co
@@ -1974,113 +1974,786 @@
     
-%7D;%0A%0A      this.destroy = function () %7B%0A        this.$printframe.remove();%0A        this.$printframe = null
+  %0A        return $frame;%0A      %7D;%0A%0A      // add print button%0A      context.memo('button.print', function () %7B%0A        // create button%0A        var button = ui.button(%7B%0A          contents: '%3Ci class=%22fa fa-print%22/%3E ' + lang.print.print,%0A          tooltip: lang.print.print,%0A          click: function () %7B%0A            $frame = getPrintframe();%0A            $frame.contents().find('body').html(context.invoke('code'));%0A            %0A            setTimeout(function () %7B%0A              $frame%5B0%5D.contentWindow.focus();%0A              $frame%5B0%5D.contentWindow.print();%0A              $frame.remove();%0A              $frame = null;%0A            %7D, 250);%0A          %7D%0A        %7D);%0A        // create jQuery object from button instance.%0A        var $print = button.render();%0A        return $print
 ;%0A  
@@ -2757,16 +2757,17 @@
 %0A      %7D
+)
 ;%0A    %7D%0A

Fix bug for multiple summernote instances