Why do I receive an error when using the File-> Print option in Mac OS X in MATLAB?

13 views (last 30 days)
I get one of the following two error messages when I try to print from the MATLAB Desktop File menu in Mac OSX:
a)
??? Error using ==> send at 129
Error using ==> send at 129
Problem sending file to output device, system returned error :
lpr: The printer or class was not found.
Error in ==> printdlg>LocalInitFig at 469
if LocalJavaPrintDlg( Data, Dlgname )
Error in ==> printdlg at 100
Dlg=LocalInitFig(Data);
??? Error while evaluating uimenu Callback
b) ERROR: ??? Error using ==> print at 310 Problem sending file to output device, system returned error : lpr: The printer or class was not found. Error in ==> print at 310 throw(ex); Error in ==> printdlg>LocalJavaPrintDlg at 749 print(Data.Fig, pOpts{:}); Error in ==> printdlg>LocalInitFig at 469 if LocalJavaPrintDlg( Data, Dlgname ) Error in ==> printdlg at 100 Dlg=LocalInitFig(Data); ??? Error while evaluating uimenu Callback
Printing from the command window using the function PRINT works fine.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 Feb 2017
This problem can occur when printing to a printer with a name that includes characters other than alphanumeric and underscores. In these situations, the “user-visible name” of the printer differs from the “programmatic name” of its queue, and MATLAB is unable to determine the programmatic name.
There are two solutions to this issue, both of which require administrative privileges. You may need the help of your IT department or a user with administrative privileges to take the following steps.
Simpler, Less Flexible Solution: Rename your printer so that its name includes only alphanumeric and underscore characters. This includes avoiding dots (“.”) in the name of networked printers.
More Complex, More Flexible Solution: Configure your Mac to provide the printer queue information MATLAB requires. You will need root access to perform these steps:
1. In Safari, navigate to "http://localhost:631"
2. Click on the “Administration” tab, and then “Edit Configuration File”
3. At the top of the editable block of text, add these lines:
Printcap /etc/printcap
PrintcapFormat BSD # For Snow Leopard only
4. Click “Save Changes”. It may take 30 seconds or longer for these changes to go into effect.
5. Restart MATLAB.
If this solution to provide the printer queue information does not resolve the issue, you may have to rename your printer as outlined in the first solution. This may happen if your printer name contains square brackets "[ ]", among other unsupported characters.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!