Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法从浏览器打印 XML 或 TXT 文件?我有一台热敏打印机,我想用 javascript 从浏览器发送这种格式的一种。通常,浏览器弄脏文件并且打印机无法识别格式。
提前谢谢了,
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.