Posts Tagged ‘Printing’

Configure network printers via command line on Macs

Wednesday, December 26th, 2012

In a recent Twitter conversation with other folks supporting Macs we discussed ways to programmatically deploy printers. Larger environments that have a management solution like JAMF Software’s Casper can take advantage of its ability to capture printer information and push to machines. Smaller environments, though, may only have Apple Remote Desktop or even nothing at all.

Because Mac OS X incorporates CUPS printing, administrators can utilize the lpadmin and lpoptions command line tools to programmatically configure new printers for users.

lpadmin

A basic command for configuring a new printer using lpadmin looks something like this:

lpadmin -p "salesbw" -v "lpd://192.168.1.10/" -D "Sales B&W" -L "2nd floor print center" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet 8150 Series.gz" -E

Several options follow the lpadmin command:

  • -p = Printer name (queue name if sharing the printer)
  • -v = IP address or DNS name of the printer
  • -D = Description of the printer (appears in the Printers list)
  • -L = Location of the printer
  • -P = Path the the printer PPD file
  • -E = Enable this printer

The result of running this command in the Terminal application as an administrator looks like this:

New printer

lpoptions

Advanced printer models may have duplex options, multiple trays, additional memory or special features such as stapling or binding. Consult the printer’s guide or its built-in web page for a list of these installed printer features.

After installing a test printer, use the lpoptions command with the -l option in the Terminal to “list” the feature names from the printer:

lpoptions -p "salesbw" -l

The result is usually a long list of features that may look something like:

HPOption_Tray4/Tray 4: True *False
HPOption_Tray5/Tray 5: True *False
HPOption_Duplexer/Duplex Unit: True *False
HPOption_Disk/Printer Disk: *None RAMDisk HardDisk
HPOption_Envelope_Feeder/Envelope Feeder: True *False
...

Each line is an option. The first line above displays the option for Tray 4 and shows the default setting is False. If the printer has the optional Tray 4 drawer installed then enable this option when running the lpadmin command by following it with:

-o HPOption_Tray4=True

Be sure to use the option name to the left of the slash not the friendly name with spaces after the slash.

To add the duplex option listed on the third line add:

-o HPOption_Duplexer=True

And to add the envelope feeder option listed on the fifth line add:

-o HPOption_Envelope_Feeder=True

Add as many options as necessary by stringing them together at the end of the lpadmin command:

lpadmin -p "salesbw" -v "lpd://192.168.1.10/" -D "Sales B&W" -L "2nd floor print center" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet 8150 Series.gz" -E -o HPOption_Tray4=True -o HPOption_Duplexer=True -o HPOption_Envelope_Feeder=True

The result of running the lpadmin command with the -o options enables these available features when viewing the Print & Scan preferences:

Printer options

With these features enabled for the printer in Print & Scan, they also appear as selectable items in all print dialogs:

Printer dialog

 

Enable AirPrint On Mac OS X Server

Monday, March 7th, 2011

Since the introduction of AirPrint in iOS version 4.2.1, a handful of shareware and freeware solutions have been introduced that allow iOS devices to use AirPrint to print documents on “unsupported” printers (namely, those printers that do not have the necessary AirPrint features built-in). This typically requires enabling printer sharing on a Mac system, as well as making a slight modification to the CUPS configuration file at /etc/cups/cupsd.conf, which the software typically does for you.

However, one of the more prominent solutions available, AirPrint Activator from Netputing.com, does not work properly on a Mac OS X Server system when following the provided instructions, which appear to be aimed at users running the non-Server version of Mac OS X. Here are the steps you can follow to get Mac OS X Server v10.6 to share printer queues to AirPrint-enabled iOS devices:

Prerequisites: Mac OS X Server v10.6.5 or later (I have only tested on 10.6.6), one or more networked or local printers, and one or more iOS devices running iOS 4.2.1

1. In the System Preferences > Print & Fax preference pane, delete all existing printer queues from the server.

2. Download AirPrint Activator from http://netputing.com/airprintactivator/ to the Mac OS X Server system from which you wish to host print queues.

3. Launch the AirPrint Activator program and slide the Activator switch to On (you will be prompted to authenticate).

4. With your favorite text editor, open the file /etc/cups/cupsd.conf

5. Locate the line that reads Browsing Off and change it to read Browsing On. Save the changes.

6. Open Server Admin and enable and Start the Print service.

7. Open the System Preferences > Print & Fax preference pane and add the printers that you wish to share, being sure to give the shared print queue a unique Sharing Name a Location. If you are only using the Print service to connect iOS devices, you may want to include “AirPrint” in the queue or location name (ie, “AirPrint to Accounting Printer”).

8. In the Print service window, select the Queues tab and select the print queue you wish to share.

9. Enable the IPP protocol. You can enable the other protocols if you want to enable printer sharing to platforms beyond just your iOS devices.

10. Follow steps 7 through 9 with the other printers that you wish to use for AirPrint.

11. From an iOS device, open a supported document such as a PDF, JPG, or other printable file.

12. Click the box with a curved arrow pointing to the upper right to invoke the Print command.

13. Select the Printer from the menu and print your documents!

Have iPad, Must Print?

Wednesday, December 8th, 2010

iOS 4.2 introduced a number of new features for the iPad. One of the most talked about was multi-tasking, along with AirPlay and Game Center. But another feature allows the iPad to be used by more people when at work: AirPrint. AirPrint introduces the ability to wirelessly print to AirPrint-enabled printers.

AirPrint-enabled printers are not yet common though, with HP having a number of devices supporting AirPrint currently include HP’s Envy e-All-in-One D410a, Photosmart Plus e-AiO (B2210a), Photosmart Premium e-AiO (C310a) and Photosmart Premium Fax e-AiO (C410a).

If you have a printer that you love and don’t want to wait for a new version of the firmware that supports AirPrint or want to buy one, then there is a great little app called Printopia that can be used to print through your computers, or even to image files on your computer. Printopia can be found at http://www.ecamm.com/mac/printopia.

Printing is not yet available for all apps that you may have installed. It is built into Safari, Mail, Photos, Pages, Keynote and Numbers. Printing is also available in some newer versions of third party applications.

Note: Printing is not available for any devices that do not yet support multi-tasking (which includes the iPhone 3g by the way).

Setup HP OfficeJet Printers Using Terminal Services

Wednesday, September 9th, 2009

Often times remote users have Officejet printers and would like them redirected in Terminal Services. Prior to the new version of remote desktop, this was difficult to do. Most times, the user had to lose functionality locally on their printer in order to get this to work. With the latest version of Remote Desktop for Windows, (version 6), this is no longer an issue. The printer will redirect as it’s supposed to. The following are the steps to successfully accomplish this.

1. Download the drivers. You must ensure the server has the drivers before redirection will take place. You can open up the printer control panel, and open up the print server properties from there and search for the driver. If the driver is not there, you must install it. If, for example, HP does not have just the driver, but the entire install suite, install only the printer portion, and choose the option to install even though the printer is not plugged in (sometimes this will require that the server be rebooted). Open up the print server menu from the printer control panel again, and confirm the printer is there.

2. Ensure the remote client is using Windows XP SP2, if they are not at SP2, they will not be able to upgrade Remote Desktop to version 6. Once you have ensured that they are running SP2, have the user go to: http://support.microsoft.com/kb/925876 and select the appropriate version for their OS. It will then ask the user to validate their version of Windows. Once this is done, install the new version of Remote Desktop and test. They should be good to go now.

Scripting Printers in Windows

Wednesday, May 14th, 2008

It’s possible to deploy printers to a windows environment when all the client computers are joined to the domain.

First, add the printers to the print server.
Second, make sure that on the print server you have also installed the drivers that the clients will require.

Open up notepad and use the following script template:

rundll32 printui.dll,PrintUIEntry /in /n \\servername\hplj4025
rundll32 printui.dll,PrintUIEntry /in /n \\servername\hpp2015

Save the text file as [whatevernameyouwant].bat

Place it somewhere in Sysvol Scripts or netlogon.

Open up Group Policy Management.
Create the GPO where you would like (in SBS put it with all of the others at the root of the domain).
Go to User Configuration > Windows Settings > Scripts
Go to “logon” and add the script location.

You have now added a logon script that will deploy Printers via a GPO. If the printers are already there, then it will not error, but it wont crash anything either.

Using a Canon ImageRunner with Mac OS X

Friday, June 30th, 2006

Canon Imagerunner C6800

http://www.ikon.com/products/Multi-Functional/Color/Canon_imageRUNNER_C6800.asp

Printer is set up for network printing however job code is needed in order for the printer to print job.

Here are the instructions for setting up a Mac to work with this networked printer.

Download and install the driver here:

http://www.usa.canon.com/html/download/impd1.html

Open Printer Setup Utility
Click Add Printer
Select IP Printer at the Top
Protoco LPD
—> IMPORTANT! Queue needs to be lowercase “print”
Name the printer anything. ImageRunner 6800
Printer Model > Canon > Canon iR C6800-D1
Click Add

Printing Instructions
Job code needs to be obtained prior to printing. Printer will not print without the job code. Candice can give you the 4 digit code. This code needs to be entered each time you print per application.
Hit Print
Select the printer
In the third pull down menu, choose “Fiery Job Notes”
Enter the job code in the Department ID field