MATLAB: Are all of the printers displayed as having the name “DeviceURI Socket” in MATLAB 6.5.1 (R13SP1) on Linux

deviceurilocaljavaprintdlgMATLABprintprintdlgsocket

When I try to print from the File menu in MATLAB by selecting "File -> Print…" from the figure menu bar, the correct number of printers is displayed in the dialog but they all have the same name, "DeviceURI Socket".
When I print, I receive the following error message:
??? Error while evaluating uimenu Callback.
??? Error using ==> printdlg (LocalJavaPrintDlg)
Error using ==> print
Error using ==> /usr/local/matlabr13/toolbox/matlab/graphics/private/send
Problem sending file to output device, system returned error :
lpr: error - unable to print file: client-error-not-found
Error in ==> /usr/local/matlabr13/toolbox/matlab/uitools/printdlg.m
(LocalInitFig)
On line 464 ==> if LocalJavaPrintDlg( Data, Dlgname )
Error in ==> /usr/local/matlabr13/toolbox/matlab/uitools/printdlg.m
On line 100 ==> Dlg=LocalInitFig(Data);

Best Answer

This is due to the CUPS configuration on the Linux Debian system.
MATLAB looks for the "printers.conf" file in the directory /etc. However, in Debian systems, this file is located in /etc/cups.
CUPS generates its own /etc/printcap file for compatibility with applications that want to use the old printing system (for example lpr). For some reason, Debian sets that file to be in /var/run/cups/printcap instead of the default /etc/printcap.
To work around this issue, change the line in /etc/cups/cups.conf corresponding to the printcap file, remove the soft link in /etc/printers.conf to /etc/cups/printers.conf (if one exists), and restart CUPS.
At this point, the /etc/printcap file should contain the right information for MATLAB to print.