How to get your stuff on paper from macOS and Linux
This tutorial describes how to print to paper.
This updates the previous page at https://wilsonmar.github.io/printing
NOTE: Content here are my personal opinions, and not intended to represent any employer (past or present). “PROTIP:” here highlight information I haven’t seen elsewhere on the internet because it is hard-won, little-know but significant facts based on my personal research and experience.
As the world undergoes “Digital Transformation”, less and less paper is the objective.
That means when paper is printed, it would be more and more dear.
Premium paper stock have a finer grain, which make the output richer looking.
PROTIP: Before spending the money, get the highet resolution version of an image.
To reduce file size, some applications (Microsoft Word, PowerPoint, etc.) reduce the “color profile” and/or pixel resolution of images when an image is pasted onto the app. So archive the original file to have it at the highest resolution, in .png file type, in case you need it in the future.
Many printers can receive print jobs by sending email to an address over the public internet.
Emailing means you don’t have to install a driver specific to a printer via WiFi on the same network or USB cabled connection.
This allows anyone to print to your printer by sending an email attached with a file to be printed (PDF, png, jpg, tiff, etc.).
An example for HP is 47aicco56ajanb@hpeprint.com.
So some configuration is necessary to connect to
VIDEO: Epson printers also can have an email address.
Have canvases and posters printed on large format printers at a FedEx Kinkos retail center. Click “START ORDER” for a form to drop a file onto. Cost is $1.99 per square foot (as of this writing).
Click the Apple icon in the menu at the top-right corner, System Preferences, “Printers & Scanners”.
Click the name of the printer you want to print to. Example: “HP OfficeJet 4650 series”, then “Add”.
Alternately, if you don’t see the printer, add it. PROTIP: Rather than allowing drivers to be intalled, HP and other printer manufacturers now have users to install entire applications on your laptop to serve up advertisements. Install on your iPhone or Android mobile app from:
Plug a USB cable of 3 meters or less (9 ft 10 in) in length.*
Within most GUI applications, hold command and press P (command-P) to “Print”. A pop-up dialog should appear.
Click “Show Details” for Advanced print settings
When you click OK, a file containing Postscript code is sent to the Print Queue, which can take a few seconds. The Print Queue is represented by a printer icon in the Apple Dock. Double-click on the Printer Icon to manage the print queue.
Most printer hardware today output to the Postscript standard rather than the older Postfix standard.
Ghostscript uses smart filters to recognize whether it is receiving Postscript or text, then translates inputs to the language of each specific printer. printer driver integrated part of Ghostscript.
app output -> Ghostscript -> queue -> printer
On Linux (CentOS) the CUPS (Common UNIX Printing System) scheduler daemon listens on IPP or print streams to be processed into GhostScript.
On macOS: brew install cups
On Linux:
yum install cups installs like 48 dependencies.
Configure web interface from remote systems:
vim /etc/cups/cupsd.conf
MaxLogSize 0 DefaultEncryption Never LogLevel warn Listen localhost:631 Listen 192.168.56.106:631 Listen /var/run/cups/cups.sock # Show shared printers on the local network: Browsing On BrowseLocalProtocols dnssd DefaultAuthType Basic WebInterface Yes <Location /> Order allow,deny allow localhost allow 192.168.56.106/24 <Location> <Location /admin> Order allow,deny allow localhost allow 192.168.56.106/24 <Location>
Alternately, configure printer access settings using CLI:
lpadmin -p printer -E -v device -m name-of-ppd
-E
specifies an Encrypted connection to the printer (like HTTPS).
This updates file /etc/cups/cupsd.conf which defines policies in XML format.
CUPS is started by default. But …
systemctl start cups
http://localhost:631/admin
“Web Interface is Disabled”
In CLI: cupsctl WebInterface=yes
See if available
netstat -tln
How’s the CUPS (Common UNIX Printing System) scheduler daemon?
On MacOS:
systemctl status cups
On Linux:
systemctl status cups service cups status
Open the printer management GUI webapp Welcome page on port 631:
firefox http://localhost:631/admin
NOTE: The program was designed by Apple for OSX.
To list available printer models:
lpinfo -m
To list available connection types:
lpinfo -v
Response:
serial serial:/dev/ttys0?baud=115200 network lpd network ipp network smb network https network ipps network http network socket direct epsonfax direct parllel:/dev/lp0
Printer definition (PPD files) which define each printer can exist in several folders:
find / -name "*ppd" 2>/dev/null
Example output:
/usr/bin/cupstestppd /usr/sbin/pppd /usr/local/Cellar/ghostscript/9.50/share/ghostscript/9.50/lib/cbjc600.ppd /usr/local/Cellar/ghostscript/9.50/share/ghostscript/9.50/lib/ghostpdf.ppd /usr/local/Cellar/ghostscript/9.50/share/ghostscript/9.50/lib/cbjc800.ppd /System/Library/Printers/Libraries/ipp2ppd /private/etc/cups/ppd /private/etc/cups/ppd/NYC-SecurePrint-BW.ppd /private/etc/cups/ppd/undefined.ppd /private/etc/cups/ppd/NYC-SecurePrint-Color.ppd /Users/wilson_mar/Library/Application Support/WebEx Folder/T33_64UMC_39.11.6.33/Meeting Center.app/Contents/PlugIns/pd.bundle/Contents/Resources/Webex_PDF_Printer.ppd /Applications/Microsoft Word.app/Contents/Frameworks/MetEx.framework/Versions/A/Resources/encoding/adpdf6cs.ppd
List PPD printer definitions defined in a file which requires sudo to view:
/etc/cups/printers.conf
Define the default printer:
lpadmin -d textprinter
To inactivate a queue:
cupsdisable
To activate a queue:
cupsenable
See if a printer is ready:
lpr -Ptextprinter
Send the hosts file as a print job to the default printer:
lpr -Ptextprinter /etc/hosts
lpr -P p1 /etc/cups
List print jobs:
lpq -Pprintername
Remove last print job:
lprm
Remove all my print jobs (stalled in the print queue):
lprm --
See who accessed the printer:
tail /var/log/cups/access_log
List errors:
tail /var/log/cups/error_log
https://www.youtube.com/watch?v=oHYOdYwasUA&t=3m4s
https://learning.oreilly.com/videos/comptia-linux/9780134426365/9780134426365-LPC2_01_02_00
This is one of a series on Mac OSX: