我有一些HTML文本,比如
<h1>lorem... </h1>
<b> Lorem text going on...我想在任何打印机上打印HTML
WebEngine webEngine = WebView.getEngine();
webEngine.loadContent(html);
webEngine.print(javafx.PrinterJob);但结果是在botten上被切掉了一页...chrome的打印功能具有我所指的功能。
发布于 2020-02-26 02:03:41
好吧。我在我的案例中得到了这个解决方案。我使用的是JEditorPane
JEditorPane editorPane = new JEditorPane();
editorPane.setContentType("text/html");
editorPane.setText("<html>...");
editorPane.print(null, null, false, javax.print.PrintService, null, false);现在有了自动分页符
https://stackoverflow.com/questions/60381700
复制相似问题