Page 1 of 1

print to physical printer on a mac

Posted: Sun Apr 15, 2012 11:03 pm
by amyhughes
Last week I figured out how to print to a physical printer from a PHP script on a Windows machine. This week...same question, with a Mac.

It's theoretically much simpler on a mac. The lpr command deals well with PDF files, so in theory this should work:

shell_exec('lpr ' . $filename);

But that fails (returns false). It doesn't work with a full path name, either.

Any clue? The script is able to write to the file, so those permissions are okay. Might it be a permissions problem in printing?

Re: print to physical printer on a mac

Posted: Mon Apr 16, 2012 1:30 pm
by pickle
You may need to specify the name of the printer with -P