如何防止超出行间距复制/将tinyMCE编辑器内容转换为Word / PDF

时间:2017-10-26 12:10:42

标签: php pdf ms-word tinymce

我在我的浏览器应用程序中使用tinyMCE作为应用内编辑器。 我遇到的问题是尝试复制和粘贴或使用各种转换方法在MS Word Docx或PDF中呈现tinyMCE编辑器的内容。 段落突然变成它们在tinyMCE编辑器中出现的高度的两倍。 *更正:实际上每个段落都会产生2个换行符。 * 下面是我的一个init调用的示例。我已尝试在我的示例中使用各种强制...和remove_linebreaks设置等设置,但没有取得明显成功。 还有一个建议是在css中的某处设置p标签填充属性,但无法弄清楚在哪里。还有其他想法吗?

     tinymce.init({
     selector: 'textarea#myTextareadisp'+ind,
     theme: 'modern',
     width: nwidth,
     plugins: ['contextmenu paste fullscreen'],
     contextmenu: 'undo | copy selectall | fullscreen preview',
     height: nheight,
     toolbar: false,
     menubar: false,
     statusbar: false,
     force_br_newlines : true,
     force_p_newlines : false,
     forced_root_block : '', // Needed for 3.x
     remove_linebreaks : true,
     forced_root_blocks: false
  });

1 个答案:

答案 0 :(得分:1)

您可以使用 on('copy')事件来控制复制并播放该内容的内容。