Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

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


Date Last Modified: Wednesday, July 20, 2011
Solution ID:   1-5DRO9Z
Product:   MATLAB
Reported in Release:   R2008a
Platform:   Mac Intel
Operating System:   All Mac Intel
 

Subject:

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

Problem Description:

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 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.

Solution:

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.

Please provide feedback to help us improve this Solution
Contact support