このイラストを印刷したいんだけど、どうすればいいの?
・・・iPhone4を握りしめて娘が言った。これに答えられないってどうなのよ?
ということで、AirPrintで印刷する方法を模索。
うちにはネットワーク対応で、常に電源を入れっぱなしにしている HP の C309a があるから、これをAirPrintで使えないかなと調べ始めた。
C309a は AirPrint 非対応。
結論からすると、
- UbuntuにC309aのドライバをインストール
- UbuntuでAvahiにC309aを登録
で印刷ができるように。早くやっておけばよかった。
ドライバのインストール。HPの公式ホームページには Windows と Macintosh のドライバしか置いていなかった。どうやら、Linuxは非公式対応になっているらしい。
HP Linux Imaging and Printing(※リンク切れのためアーカイブへ) から C309a を探し、
hplip-3.16.3.run
をダウンロード。
$ sh hplip-3.16.3.run Creating directory hplip-3.16.3 Verifying archive integrity... All good. Uncompressing HPLIP 3.16.3 Self Extracting Archive..................................................... HP Linux Imaging and Printing System (ver. 3.16.3) HPLIP Installer ver. 5.1 Copyright (c) 2001-15 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. Installer log saved in: hplip-install_Sat-09-Apr-2016_14:37:39.log \ note: Defaults for each question are maked with a '*'. Press to accept the default. -/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display warnings.warn(str(e), _gtk.Warning) INSTALLATION MODE ----------------- Automatic mode will install the full HPLIP solution with the most common options. Custom mode allows you to choose installation options to fit specific requirements. Please choose the installation mode (a=automatic*, c=custom, q=quit) : a Initializing. Please wait... INTRODUCTION ------------ This installer will install HPLIP version 3.16.3 on your computer. Please close any running package management systems now (YaST, Adept, Synaptic, Up2date, etc). DISTRO/OS CONFIRMATION ---------------------- Distro appears to be Ubuntu 14.04. Is "Ubuntu 14.04" your correct distro/OS and version (y=yes*, n=no, q=quit) ? y ENTER USER PASSWORD ------------------- Please enter the sudoer (hogeuser)'s password: *パスワードを入力* INSTALLATION NOTES ------------------ Enable the universe/multiverse repositories. Also be sure you are using the Ubuntu "Main" Repositories. See: https://help.ubuntu.com/community/Repositories/Ubuntu for more information. Disable the CD-ROM/DVD source if you do not have the Ubuntu installation media inserted in the drive. Please read the installation notes. Press to continue or 'q' to quit: *Enter*を入力 SECURITY PACKAGES ----------------- AppArmor is installed. AppArmor protects the application from external intrusion attempts making the application secure Would you like to have this installer install the hplip specific policy/profile (y=yes, n=no*, q=quit) ? y RUNNING PRE-INSTALL COMMANDS ---------------------------- OK MISSING DEPENDENCIES -------------------- Following dependencies are not installed. HPLIP will not work if all REQUIRED dependencies are not installed and some of the HPLIP features will not work if OPTIONAL dependencies are not installed. Package-Name Component Required/Optional pyqt4 gui_qt4 REQUIRED libusb base REQUIRED cups-image base REQUIRED libnetsnmp-devel network REQUIRED sane-devel scan REQUIRED xsane scan OPTIONAL pyqt4-dbus gui_qt4 REQUIRED libjpeg base REQUIRED cups-devel base REQUIRED dbus fax REQUIRED Do you want to install these missing dependencies (y=yes*, n=no, q=quit) ? y INSTALL MISSING REQUIRED DEPENDENCIES ------------------------------------- note: Installation of dependencies requires an active internet connection. warning: Missing REQUIRED dependency: libusb (libusb - USB library) warning: Missing REQUIRED dependency: cups-image (CUPS image - CUPS image development files) warning: Missing REQUIRED dependency: libjpeg (libjpeg - JPEG library) warning: Missing REQUIRED dependency: cups-devel (CUPS devel- Common Unix Printing System development files) warning: Missing REQUIRED dependency: libnetsnmp-devel (libnetsnmp-devel - SNMP networking library development files) warning: Missing REQUIRED dependency: pyqt4 (PyQt 4- Qt interface for Python (for Qt version 4.x)) warning: Missing REQUIRED dependency: pyqt4-dbus (PyQt 4 DBus - DBus Support for PyQt4) warning: Missing REQUIRED dependency: dbus (DBus - Message bus system) warning: Missing REQUIRED dependency: sane-devel (SANE - Scanning library development files) INSTALL MISSING OPTIONAL DEPENDENCIES ------------------------------------- note: Installation of dependencies requires an active internet connection. warning: Missing OPTIONAL dependency for option 'scan': xsane (xsane - Graphical scanner frontend for SANE) CHECKING FOR NETWORK CONNECTION ------------------------------- Network connection present. RUNNING PRE-PACKAGE COMMANDS ---------------------------- sudo dpkg --configure -a (Pre-depend step 1) sudo apt-get install --yes --force-yes -f (Pre-depend step 2) sudo apt-get update (Pre-depend step 3) OK DEPENDENCY AND CONFLICT RESOLUTION ---------------------------------- Running 'sudo apt-get install --assume-yes libusb-1.0.0-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes libcupsimage2-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes libjpeg-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes libcups2-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes cups-bsd' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes cups-client' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes libsnmp-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes snmp-mibs-downloader' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes gtk2-engines-pixbuf' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes python-qt4' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes python-qt4-dbus' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes libdbus-1-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes libsane-dev' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes gtk2-engines-pixbuf' Please wait, this may take several minutes... Running 'sudo apt-get install --assume-yes xsane' Please wait, this may take several minutes... HPLIP-3.14.3 exists, this may conflict with the new one being installed. Do you want to ('i'= Remove and Install*, 'q'= Quit)? :i Starting uninstallation... HPLIP uninstallation is completed RUNNING POST-PACKAGE COMMANDS ----------------------------- OK RE-CHECKING DEPENDENCIES ------------------------ PRE-BUILD COMMANDS ------------------ OK BUILD AND INSTALL ----------------- Running './configure --with-hpppddir=/usr/share/ppd/HP --prefix=/usr --enable-qt4 --disable-libusb01_build --enable-doc-build --disable-cups-ppd-install --disable-foomatic-drv-install --disable-foomatic-ppd-install --disable-hpijs-install --disable-udev_sysfs_rules --disable-policykit --enable-cups-drv-install --enable-hpcups-install --enable-network-build --enable-dbus-build --enable-scan-build --enable-fax-build --enable-apparmor_build' Please wait, this may take several minutes... Command completed successfully. Running 'make clean' Please wait, this may take several minutes... Command completed successfully. Running 'make' Please wait, this may take several minutes... Command completed successfully. Running 'sudo make install' Please wait, this may take several minutes... Command completed successfully. Build complete. POST-BUILD COMMANDS ------------------- CLOSE HP_SYSTRAY ---------------- Sending close message to hp-systray (if it is currently running)... HPLIP UPDATE NOTIFICATION ------------------------- Do you want to check for HPLIP updates?. (y=yes*, n=no) : n RESTART OR RE-PLUG IS REQUIRED ------------------------------ If you are installing a USB connected printer, and the printer was plugged in when you started this installer, you will need to either restart your PC or unplug and re-plug in your printer (USB cable only). If you choose to restart, run this command after restarting: hp-setup (Note: If you are using a parallel connection, you will have to restart your PC. If you are using network/wireless, you can ignore and continue). Restart or re-plug in your printer (r=restart, p=re-plug in*, i=ignore/continue, q=quit) : i PRINTER SETUP ------------- Please make sure your printer is connected and powered on at this time. Do you want to setup printer in GUI mode? (u=GUI mode*, i=Interactive mode) : u HP Linux Imaging and Printing System (ver. 3.16.3) Printer/Fax Setup Utility ver. 9.0 Copyright (c) 2001-15 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. warning: No display found. error: hp-setup requires GUI support (try running with --qt3). Also, try using interactive (-i) mode. error: hp-setup failed. Please run hp-setup manually. RE-STARTING HP_SYSTRAY ---------------------- HP Linux Imaging and Printing System (ver. 3.16.3) System Tray Status Service ver. 2.0 Copyright (c) 2001-15 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. warning: No display found. error: hp-systray requires Qt4 GUI and DBus support. Exiting.
最後にエラーになったのは、TeraTermで接続してこの操作をしたから。
VNCで接続して、
$ hp-setup
を実行する。
画面が表示されたら、
- Network/Ethernet/Wireless network (direct connection or JetDirect) を選択
- Advanced Options を開く
- Manual Discovery にチェックを入れ、 IP Address or network name: にプリンタのIPアドレスを入力
後は画面に従って進めて登録完了。
登録時にテスト印字をしてみたら、ちゃんと印刷されたよ、良かったよ。
次に、以下のファイルを作成。作成方法は「mkiuchiの日記 2冊め」さんの「今日はLinuxのCUPSプリントサーバをAirPrintサーバにして、iPhoneからAirPrintで印刷するとPDFファイルが生成されるようにしてみた」を参考にさせていただき、さくっと作った。
/etc/avahi/services/hpc309a.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*--> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <!-- This file is part of udisks --> <service-group> <name replace-wildcards="yes">AirPrint %h</name> <service> <type>_ipp._tcp</type> <subtype>_universal._sub._ipp._tcp</subtype> <port>631</port> <txt-record>txtvers = 1</txt-record> <txt-record>Color = T</txt-record> <txt-record>pdl = application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf</txt-record> <txt-record>printer-state = 3</txt-record> <txt-record>priority = 0</txt-record> <txt-record>product = (HP Photosmart Premium Fax All-in-one Printer - c309a)</txt-record> <txt-record>qtotal = 1</txt-record> <txt-record>Duplex = T</txt-record> <txt-record>ty = Unknown</txt-record> <txt-record>printer-type = 0x901E</txt-record> <txt-record>rp = printers/Photosmart_C309a</txt-record> <txt-record>URF = DM3</txt-record> <txt-record>TLS = 1.2</txt-record> <txt-record>URF=none</txt-record> </service> </service-group>
ファイルを作ったら、avahiデーモンを再起動。
$ sudo service avahi-daemon restart
たったこれだけで印刷ができるようになった。
さぁ、ということでiPhoneからカメラロールに保管されているイラストを印刷しようとしたら・・・紙がない、と。
どうやら、イラスト印刷するときは、写真用のトレイが使用されるらしい。
さっそく、A6用紙を買ってきてセット。
・
・
・
印刷できたーっ!
コメントはこちらから お気軽にどうぞ ~ 投稿に関するご意見・感想・他