nbalonso.com

Customize a Printer Driver in OS X

| Comments

In my company we use Pharos as a central printing solution for managing, cost saving and so on. One of the default settings that we apply is to always have the duplex printing as default to encourage users doing a better use of the paper.

This option is easy to manage from the Pharos server for Windows computers, but as seen other times it is not the case for OS X clients. To work around this I decided to edit .ppd file and include it with the queue installation.

First grab a copy of the default Generic.ppd file located in your computer and place it in your .Custom folder. The full path is

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/

Then we only need to change two lines. Open the file with your favorite text editor change this two option on lines 17 and 38:

...
*DefaultAPOptionalDuplexer: True
…
*DefaultDuplex: DuplexNoTumble
...

Done. Since you are here you could also modify paper sizes, printer icon and printer name if needed.

Here a partial diff of my modified file on the right and the original .ppd on the left

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
bash-3.2$ diff -y --suppress-common-lines \
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd \
~/Desktop/Pharos\ 8.3.4/.Custom/Generic.at.pretendco.ppd
                                                              >  *%***********************************************************
                                                              >  *%  Pretendco Customization
                                                              >  *NickName: "Pharos Print Server"
                                                              >  *APPrinterIconPath: "/Library/Pretendco/Resources/Pharos.icns"
                                                              >  *%***********************************************************
                                                              >
*DefaultAPOptionalDuplexer: False                             | *DefaultAPOptionalDuplexer: True
*DefaultDuplex: None                                          | *DefaultDuplex: DuplexNoTumble
*PageSize Legal/US Legal: "2 dict dup /PageSize [612 1008] pu | *PageSize A3/A3: "2 dict dup /PageSize [842 1191] put dup /Im
*PageSize ISOB5/B5: "2 dict dup /PageSize [499 708] put dup / <
*PageSize B5/JISB5: "2 dict dup /PageSize [516 729] put dup / <
*PageSize LetterSmall/US Letter Small: "2 dict dup /PageSize  <
*PageSize LegalSmall/US Legal Small: "2 dict dup /PageSize [6 <
*PageSize A4Small/A4 Small: "2 dict dup /PageSize [595 842] p <
*ImageableArea Legal/US Legal: "18 15 594 993 "               | *ImageableArea A3/A3: "12 12 830 1178"
*ImageableArea ISOB5/B5: "17 3 482 705 "              <
*ImageableArea B5/JISB5: "11.52 14.2201 503.04 719.1 "        <
*ImageableArea LetterSmall/US Letter Small: "30 31 582 761 "  <
*ImageableArea LegalSmall/US Legal Small: "64 54 548 954 "    <
*ImageableArea A4Small/A4 Small: "28 30 566 811 "             <
*PageRegion Legal/US Legal: "2 dict dup /PageSize [612 1008]  | *PageRegion A3/A3: "2 dict dup /PageSize [842 1191] put dup /
*PageRegion ISOB5/B5: "2 dict dup /PageSize [499 708] put dup <
*PageRegion B5/JISB5: " 2 dict dup /PageSize [516 729] put du <
*PageRegion LetterSmall/US Letter Small: "2 dict dup /PageSiz <
*PageRegion LegalSmall/US Legal Small: "2 dict dup /PageSize  <
*PageRegion A4Small/A4 Small: "2 dict dup /PageSize [595 842] <
*PaperDimension Legal/US Legal: "612 1008 "                   | *PaperDimension A3: "841.68 1190.88"
*PaperDimension ISOB5/B5: "499 708 "                          <
*PaperDimension B5/JISB5: "516 729 "                          <
*PaperDimension LetterSmall/US Letter Small: "612 792 "       <
*PaperDimension LegalSmall/US Legal Small: "612 1008 "        <
*PaperDimension A4Small/A4 Small: "595 842 "                  <

Comments