简体   繁体   English

如何在 CKeditor 5 中打印预览?

[英]How to print preview in CKeditor 5?

I have a document or html content I'm displaying on CKEditor.我有要在 CKEditor 上显示的文档或 html 内容。 I want a print preview button on top of my document.我想在我的文档顶部有一个打印预览按钮。 I dug a lot into documentation but couldn't find the right api or plugin.我对文档进行了大量研究,但找不到合适的 api 或插件。

I found this pagebreak feature in which I can see "Open Print Preview" button which is exactly what I need, but I don't see an api or plugin information for it.我发现了这个分页功能,我可以在其中看到“打开打印预览”按钮,这正是我所需要的,但我没有看到它的 api 或插件信息。 https://ckeditor.com/docs/ckeditor5/latest/features/page-break.html https://ckeditor.com/docs/ckeditor5/latest/features/page-break.html

This answer tells me there's a native api for it, but can't find it anywhere.这个答案告诉我有一个本机api,但在任何地方都找不到。 https://github.com/ckeditor/ckeditor5/issues/5868#issuecomment-932193441 https://github.com/ckeditor/ckeditor5/issues/5868#issuecomment-932193441

Do I need to do it manually outside of CKeditor using Javascript?我需要在 CKeditor 之外使用 Javascript 手动完成吗? Let me know.让我知道。 I also tried this CKEditor - Print Button Outside Toolbar but got an error saying function is not defined.我也尝试了这个CKEditor - Print Button Outside Toolbar ,但收到一个错误,提示未定义函数。 I'm implementing it on Angular 9 currently.我目前正在 Angular 9 上实现它。

I need to be able to go the browser's print preview window upon clicking a button from toolbar or somewhere on top of the document.单击工具栏上的按钮或文档顶部的某个位置时,我需要能够进入浏览器的打印预览窗口。

CKEditor 5 team has introduced two new features - export to PDF and export to Word with similar functionality instead of the preview and print functionality which are available in CKEditor 4. CKEditor 5 团队引入了两个新功能 -导出到 PDF 和导出到 Word具有类似的功能,而不是 CKEditor 4 中可用的预览和打印功能。

https://github.com/ckeditor/ckeditor5/issues/1972 https://github.com/ckeditor/ckeditor5/issues/1972

The two new features introduced recently, export to PDF and export to Word, provide similar functionality (and even more).最近推出的两个新功能,导出到 PDF 和导出到 Word,提供了类似的功能(甚至更多)。 They allow you to export your WYSIWYG editor content to a portable, easy-to-print format, that can then be printed using your OS tools.它们允许您将所见即所得编辑器内容导出为便携式、易于打印的格式,然后可以使用您的操作系统工具进行打印。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM