Trang chủ » Diễn Đàn » Lập trình và Phát triển Web » Java » How to use window shared printer on unix java program
Chủ đề đã bị khóa, bạn không thể xóa, sửa hay trả lời trong chủ đề này!
|
|
|---|
|
0
I use FileOutputStream to open window shared printer.
on window : FileOutputStream fos = new FileOutputStream("\\mymachine\printershare"); It is ok but on Unix it fails I know I have to use SAMBA to mount that printer but have no idea. Anybody has experience How to use window shared printer on unix please point me out. Thank you very muchuch |
|
|
|
0
I use FileOutputStream to open window shared printer. Tôi chưa thử share máy in trên Win cho Linux lần nào. Nhưng nếu mà cần phải share mới in được thì tôi nghĩ bạn đầu tiên nên hỏi ở box Linux đã. Mà tôi nghĩ dù gì đầu tiên bạn cũng nên cài gói Samba vào máy để mount được 1 share folder trên Win trước. Ngoài ra bạn có thể tham khảo 1 số link sau: http://raldztech.blogsp...xp-printer-to-linux.html
---------
NBThanh Tutorial Room, cập nhật thường xuyên bài viết mới. Các bài viết mới cập nhật: - PHP - Lưu nội dung file ảnh vào CSDL NEW! - Làm việc với CSDL MySQL trong PHP - Học PHP qua ví dụ - Gởi email text, HTML, tiếng việt Unicode - Học PHP qua ví dụ - 1 chương trình download manager/giấu đường dẫn download - Học PHP qua ví dụ - Làm việc với Cookie và Session |
|
|
|
0
I set-up the Unix printer queue already. it named as d329
if I issue the command as "lp -d d329 /usr/local/javapost/textfile" then it will print out on my window shared printer. What I want is how to open that queue (d329) in java program I use FileOutputStream fos = new FileOutputStream("d329"); PrintStream ps = new PrintStream(fos); ps.print(s); ps.close(); it doesnot work, it create new file as d329. |
|
|
|
0
Printing in Java: http://www.javaworld.co...-2000/jw-1020-print.html
---------
NBThanh Tutorial Room, cập nhật thường xuyên bài viết mới. Các bài viết mới cập nhật: - PHP - Lưu nội dung file ảnh vào CSDL NEW! - Làm việc với CSDL MySQL trong PHP - Học PHP qua ví dụ - Gởi email text, HTML, tiếng việt Unicode - Học PHP qua ví dụ - 1 chương trình download manager/giấu đường dẫn download - Học PHP qua ví dụ - Làm việc với Cookie và Session |
|
|
|
0
I check the link and it is not what I want.
Program on window in order to print is not problem at all. Problem is java on AIX (Unix) I can execute Unix command "lp -D d329 pathtoTextfile" to print on java but it only prints Text. What I want is to print label on Zebra printer with EPL RAW CODE means I need to use data stream. In java on Unix platform, is there any code to open shared printer or file located on Windows? At the end I find a solution to make it works. 1/ Create a print queue on AIX (Unix) 2/ Process proc = Runtime.getRuntime().exec("lp -d" + queueName + " -o -dp -"); OutputStream fos = proc.getOutputStream(); PrintStream ps = new PrintStream(fos); ps.print(s); ps.close(); 3/using generic/text for Zebra so from Unix you can send EPL RAW CODE to window Zebra shared printer via print queue on AIX. I think maybe someone can benefit from that code. Enjoy |
|
|
|
0
Java's approach is cross-platform, so if you are looking for "Printing on Linux (either local or shared printer)" then I feel you are approaching the wrong way.
Anyway, if your solution works then fingers cross :-)
---------
NBThanh Tutorial Room, cập nhật thường xuyên bài viết mới. Các bài viết mới cập nhật: - PHP - Lưu nội dung file ảnh vào CSDL NEW! - Làm việc với CSDL MySQL trong PHP - Học PHP qua ví dụ - Gởi email text, HTML, tiếng việt Unicode - Học PHP qua ví dụ - 1 chương trình download manager/giấu đường dẫn download - Học PHP qua ví dụ - Làm việc với Cookie và Session |
