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

22 REPLIES 22

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
Valued Contributor

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

sudoErase
New Contributor III

Hi Steve,

I saw many of your posts on other stuff and helped me alot.

I have a Xerox printer and I cant seem to get it to work. 

/usr/sbin/lpadmin -p <printername> -o printer-is-shared=false -v lpd://$CURRENT_USER@<printeraddress> -P /Library/Printers/PPDs/Contents/Resources/Xerox Versant 180 Press.gz

I am not sure if the Im using the script wrong (...Resources/Xerox (does it need backslash here?))

Xerox\ Versant\ 180\ Press.gz

 

another info to provide is: in the folder, en.lproj folder: theres a file but not PPD or any extension. 

Is that what we use for PPD?

 

Any help would be appreciated!

stevewood
Honored Contributor II
Honored Contributor II

@sudoErase 

Yes, you either need backslashes or you can use quotes to contain the path to the printer driver:

/usr/sbin/lpadmin -p <printername> -o printer-is-shared=false -v lpd://$CURRENT_USER@<printeraddress> -P "/Library/Printers/PPDs/Contents/Resources/Xerox Versant 180 Press.gz"

 

The PPD is inside of the .gz file and gets copied into /etc/cups when the printer is created. 

 

Hope that helps!

 

Steve

sudoErase
New Contributor III

@stevewood Thank you for helping me with this!

Got it to work! 

But I have another printer but this one doesn't have gz or ppd. 

I have the driver installer and it installed but when I went to look for ppd or gz.

It has Unix executable file and texEdit

See the pic. "Canon iPR Sir M10 PS V2.0 US"

Is there a way to point this using a script without breaking? Screen Shot 2022-01-31 at 2.13.25 PM.pngScreen Shot 2022-01-31 at 2.12.54 PM.png

sudoErase
New Contributor III

Nevermind! Got it to work :)

This worked: 

/usr/sbin/lpadmin -p Test-printer -E -v lpd://$CURRENT_USER@<ipdaddress> -P “/Library/Printers/PPDs/Contents/Resources/en.lproj/Canon iPR Svr M10 PS V2.0 US”

 

I thought about erasing the post but in case anyone else who is new like me, they can give this a try :)

 

It takes Unix 

inflicted
New Contributor II

I have having issues pointing ricoh IM c2500 drivers as you mentioned.  In the /Library/Printers/PPDs/Contents/Resources folder, the Ricoh printer driver is not a gz or ppd file, rather it is a Document folder.  How would i use this file as the PPD file?

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