1

有没有办法从浏览器打印 XML 或 TXT 文件?我有一台热敏打印机,我想用 javascript 从浏览器发送这种格式的一种。通常,浏览器弄脏文件并且打印机无法识别格式。

提前谢谢了,

4

1 回答 1

0

I'm not sure about what you want but we can use the window.print() function to open the print dialog for the user.

For exemple you can open your xml file in a new window and then use window.print().

window.open(file.txt);
window.print();

I hope it helps you.

于 2013-12-12T10:43:07.747 回答