gpt4 book ai didi

Macbook Bootcamp Windows 上的 Java Html 呈现器

转载 作者:太空宇宙 更新时间:2023-11-04 12:40:43 24 4
gpt4 key购买 nike

我正在使用 qz-tray(一种中间件,通过连接在客户端计算机 USB 端口上的打印机从浏览器进行打印)来打印我的 POS 收据。我使用 PostScriptPrinting 来生成收据,对于 PostScriptPrinting,我使用 qz-tray 的 printHTML 功能。我的理解是 qz-tray 使用 java Html Renderer 来渲染和生成 printHTML 函数的收据。它在我的机器上运行良好,但我客户的机器是 MacBook,他在上面安装了 Bootcamp Windows。当我从 macbook 的训练营窗口生成打印时,收据的格式受到干扰。这背后的原因是什么?我该如何解决这个问题?

最佳答案

What I understand is that qz-tray uses java Html Renderer to render and generate reciepts for printHTML function.

正确,QZ Tray 1.9 使用了非常有限的内部 Java HTML 渲染器。

When I generated print from macbook's bootcamp windows, the reciept's formatting got disturbed. What can be the reason behind this? How can I solve this issue?

打印机驱动程序可能存在差异,这意味着您的答案需要更多信息(例如您正在使用的打印机和打印机驱动程序)。

例如,如果此收据打印机是 Epson,则必须安装驱动程序,并且驱动程序设置会影响输出质量。 Epson 提供适用于 MacOS、Linux 和 Windows 的驱动程序。

此外,根据 QZ Tray 版本 1.9、2.0、2.1 等,Java 7 + HTML can have considerably different results over Java 8 + HTML .

无论如何,QZ Tray 的更高版本中已弃用 PostScript 打印,因此使用最新版本应该会产生更好的效果。

var config = qz.configs.create("Printer Name");
var data = [{
type: 'html',
format: 'file', // or 'plain' if the data is raw HTML
data: 'assets/html_sample.html'
}];
qz.print(config, data).catch(function(e) { console.error(e); });

为了在热敏打印机上获得最佳 HTML 质量,QZ Tray 2.1 or higher is recommended .

关于Macbook Bootcamp Windows 上的 Java Html 呈现器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36858393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com