Dear All,

        I have some ideas on printer-redirect.


        Several days ago, I tried to realize the printer-redirect with Rdesktop-5.0 and Rdesktop-6.0 for one of our department¡¦s projects. That project was an absolute linux-based embedded system, with Arm926-ejs, 128MB DDR and some other peripheral equipments. And my printer is Epson Stylus C63 with USB interface.


        At first, I saw some instructions on the web and it said that the following changes should be done in embedded system

1.     add kernel support

2.     porting CUPS

3.     porting Guten-print

4.     start Rdesktop with ¡§-r printer:mydesktop=¡§EPSON Stylus C63¡¨¡¨ to enter server driver.


The key source code is in ¡§printer.c¡¨, from line 113 to line 121, it seems that the Rdesktop mount the printer to server as a network-printer, and use the ¡§lpr¡¨ command to deal with the received flow from server. The procedure is shown as below


(File  ->  Driver)  -->-->  Network Printer -->-->   (CUPS -> Driver -> Dev Node) -->-->  Printer

(Windows Server)                                           (Linux Client)


I tried but found it was almostly impossible for an embedded system, it takes a lot of flash-space and CPU resource.

And then I aborted porting the Guten-print but trying to find a new way. And fortunately, one day our Windows engineer told me that the flow which has been worked by Windows¡¦s driver could directly transfer to printer.


For example, I do the following changes in source code ¡§printer.c¡¨

1.     comment (or delete )from line 113 to 121:

#if 0

if (pprinter_data->printer == "mydeskjet")


pprinter_data->printer_fp = popen("lpr", "w");




sprintf(cmd, "lpr -P %s", pprinter_data->printer);

pprinter_data->printer_fp = popen(cmd, "w");



        2. add :

                                pprinter_data->printer_fp = fopen("/dev/usb/lp0", "w");


        Then start rdesktop and use parameter ¡§-r printer:mydesktop=¡§EPSON Stylus C63¡¨¡¨ to enter server driver, it was OK and working very well !!

        So, the procedure now is


        (File -> Driver)  -->-->  Network Printer -->-->   (Dev Node) -->-->  Printer

           (Windows Server)                                  (Linux Client)


        With this change, we do not need to porting any local printer-service component but could support any printer supported by Server-Windows.

        I hope this discovery could be helpful for our community.



Thanks & Regards

Pan David

Embedded Sys&App SW Dept.

IPT R&D Center, Inventec (PuDong) Corp.

789 Puxing Road, Min Hang District, Shanghai 201114, China

Tel: 86-21-6429-8888 Ext: 62851