Printer PPD Question

Yager
New Contributor III

I am working on printer deployments and have a question. I can push the HP or Xerox printer drivers to a machine, however the files are usually in .gz format. This is an issue since Casper wants the PPD file. Is there a more direct way to get the ppd sent to the machine? Do I need to script this, or am I making this harder than it needs to be? Thanks for any help!

1 ACCEPTED SOLUTION

stevewood
Honored Contributor II

I handle all printer installations via script. It just makes it easier for me that way not having to use Casper to capture the printer. I'll install driver packages if necessary, then run the script as an after item.

I locate the appropriate driver in the /Library/Printers/PPDs/Contents/Resources directory. Most drivers sit right there, but then our Xerox 560/570/C70 printers drop their Fiery drivers into en.lproj in that directory structure (and they do not end in .gz).

The main script line I use to install the printer is:

lpadmin -p <printername> -L <location> -E -o printer-is-shared=false -v lpd://<ip address> -P <driver location>

I can then use lpoptions to set further config parameters, like no duplexing:

lpadmin -p <printername> -o EFOutputBin=middle
lpadmin -p <printername> -o EFOpt_Input_HCFTray=1Tray
lpadmin -p <printername> -o EFDuplex=False
lpadmin -p <printername> -o EFManualDuplex=False
lpadmin -p <printername> -o EFGAFeaturesOpt=GA2

View solution in original post

17 REPLIES 17

bpavlov
Honored Contributor

Install drivers. Configure print queue via System Preferences. Then copy the PPD located in /etc/cups/ppd/

Eyoung
Contributor

I create (and maintain) a regular old composer package of all the PPD's for all of the printers onsite. It was a bit tedious to create (we have many many printer models) but I know I will now avoid the dreaded "Generic printer" when there is no PPD present. I find that as long as the printer gets a valid PPD at time of setup, software update will take over and keep things up to date from then on.

When I have a new machine, I deploy the PPD package out then I can easily push whatever Printer via a policy or self service.

calumhunter
Contributor III

the ppd in .gz format is normal

how are you adding the printer? lpadmin? just point it to the ppd.gz file

strider_knh
Contributor II

For network printers I will install the drivers using a package and then after creating the queue on one station I added it the JSS using Casper Admin. I can then deploy the printer to whatever station I want using a policy.

I guess you could do the same thing with local printers but I don't.

stevewood
Honored Contributor II

I handle all printer installations via script. It just makes it easier for me that way not having to use Casper to capture the printer. I'll install driver packages if necessary, then run the script as an after item.

I locate the appropriate driver in the /Library/Printers/PPDs/Contents/Resources directory. Most drivers sit right there, but then our Xerox 560/570/C70 printers drop their Fiery drivers into en.lproj in that directory structure (and they do not end in .gz).

The main script line I use to install the printer is:

lpadmin -p <printername> -L <location> -E -o printer-is-shared=false -v lpd://<ip address> -P <driver location>

I can then use lpoptions to set further config parameters, like no duplexing:

lpadmin -p <printername> -o EFOutputBin=middle
lpadmin -p <printername> -o EFOpt_Input_HCFTray=1Tray
lpadmin -p <printername> -o EFDuplex=False
lpadmin -p <printername> -o EFManualDuplex=False
lpadmin -p <printername> -o EFGAFeaturesOpt=GA2

View solution in original post

Yager
New Contributor III

We ended up going with the script used above, thanks!

stoven
New Contributor

The printer info is all kept in /etc/cups. Specifically you have the printers.conf that contains all the queue information.
So just tar up that directory and the ppd directory and it should give you everything you need. Install the drivers first to be safe.

achristoforatos
Contributor II

@stevewood

Will that script work if you are using paper cut to control printing and tracking of prints? Basically users must input credentials to allow a print to go through. Thanks in advance.

stevewood
Honored Contributor II

@achristoforatos sorry, I don't use Paper Cut so I cannot definitively answer that. How do you add printers for Paper Cut currently? If the only difference is the address format, or something like that, I'm sure you could probably use the lpadmin command to do so.

skinford
Contributor

@stevewood Good afternoon,

I wanted to thank you for the great post, also, at the MacAdmins conference this last year Scott Blake did a printer setup session which was very informative.
I only have one more hurdle. How do you make a printer to be the default by scripting it? Casper allows that if you check the button for make printer default and it works flawlessly. My scripts are running good thanks to you and Scott but I cannot seem to get that to work. I have tried every command possible and I can't set the printer to default. Do you know how that is done? I would like to thank you in advance for any information that you share.

Have a very great day today my friend!

stevewood
Honored Contributor II

@skinford glad you were able to get something out of it!

lpadmin -d <printername>

I believe that will set your the printer to default. Test it, of course.

skinford
Contributor

@stevewood Thanks, I'll give that try. When you run it the actual Printers & Scanners dialog doesn't show default like when you pick it from the list and select default. I'll test. Thank you again!

stevewood
Honored Contributor II

@skinford I may have given you the wrong command. lpadmin should work, but I'm seeing lpoptions referenced here:

make default printer

Scroll to the last post on that page and there appears to be some tests done. Sorry, just scanned that FR and have not tested any of hit.

Jimbo
New Contributor III

@stevewood Is there a way to add spaces in the printer name? I've tried simply adding spaces, using backslash, quotes, etc.

lpadmin -p HP LaserJet M401dne -L New York -o printer-is-shared=false -v lpd://00.00.00.00 -P /Library/Printers/PPDs/Contents/Resources/HP LaserJet 400 M401dne.gz

Terminal shows the following:
Printer name can only contain printable characters.

If I use only spaces, terminal reads:
Unknown argument “LaserJet".

Thanks!

stevewood
Honored Contributor II

@Jimbo

the -p flag of lpadmin is the CUPS name of the printer. You want to use the -D flag to set the display name of the printer. Also, for the -L flag you need to quote that.

So your example becomes:

lpadmin -p HP_LaserJet_M401dne -L "New York" -D "HP LaserJet M401dne" -o printer-is-shared=false -v lpd://00.00.00.00 -P /Library/Printers/PPDs/Contents/Resources/HP LaserJet 400 M401dne.gz

Make sense?

Jimbo
New Contributor III

@stevewood

Yes, thank you! Worked like a charm.

KogarahTSO
New Contributor

Can you set paper size to each tray with lpadmin? Tray 2 - A4, Tray 3 - A3, Tray 4 - B5 etc. We have a Windows print server.