mattintosh note

どこかのエンジニアモドキの備忘録

Rasberry Pi の PDF プリントサーバ化

CUPS

CUPS-PDF のインストール。

sudo yum install cups-pdf

CUPS サーバをサービスとして登録。

sudo systemctl enable cups

CUPS-PDF プリンタを登録。この辺の詳細は過去記事で。

sudo lpadmin -p CUPS-PDF -v cups-pdf:/ -P /usr/share/cups/model/CUPS-PDF.ppd -E
sudo lpadmin -d CUPS-PDF

/etc/cups/cupsd.conf

ローカルエリアからのアクセスを許可する。

--- /etc/cups/cupsd.conf.default        2015-01-30 23:19:12.555510034 +0900
+++ /etc/cups/cupsd.conf        2015-01-30 23:37:13.902035654 +0900
@@ -11,8 +11,9 @@
 LogLevel warn
 
 # Only listen for connections from the local machine.
-Listen localhost:631
-Listen /var/run/cups/cups.sock
+#Listen localhost:631
+#Listen /var/run/cups/cups.sock
+Port 631
 
 # Show shared printers on the local network.
 Browsing On
@@ -27,11 +28,15 @@
 # Restrict access to the server...
 <Location />
   Order allow,deny
+  Allow localhost
+  Allow 192.168.1.0/24
 </Location>
 
 # Restrict access to the admin pages...
 <Location /admin>
   Order allow,deny
+  Allow localhost
+  Allow 192.168.1.0/24
 </Location>
 
 # Restrict access to configuration files...

/etc/cups/cups-pdf.conf

デフォルトの出力先を ~/Desktop から ~/spool に変更する。(*ここでは例として。実際には共有しているネットワークドライブ上に出力させる)

--- /etc/cups/cups-pdf.conf.default     2015-01-30 23:18:33.385981966 +0900
+++ /etc/cups/cups-pdf.conf     2015-01-30 23:48:46.083410560 +0900
@@ -43,7 +43,8 @@
 ### Default: /var/spool/cups-pdf/${USER}
 
 #Out /var/spool/cups-pdf/${USER}
-Out ${DESKTOP}
+#Out ${DESKTOP}
+Out ${HOME}/spool
 
 ### Key: AnonDirName
 ##  ABSOLUTE path for anonymously created PDF files

CUPS サーバを再起動。

sudo systemctl restart cups

ブラウザで Raspberry Pi にアクセスして CUPS の設定画面が表示されるか確認する。

firefox http://192.168.1.XXX:631

(下の画像は使い回し)

Samba

/etc/samba/smb.conf

ネットワークからの検索を有効にしておく。

[printers]
    browseable = yes

Samba サーバを再起動。

sudo systemctl restart smb

クライアント設定(Linux Mint Cinnamon)

ネットワークプリンタを検索する。

上で登録した CUPS-PDF を選択。

ドライバを選択する。ここでは Generic を選択。

CUPS-PDF を選択。(無ければパッケージマネージャで cups-pdf をインストール???)

クライアント設定(Windows

「ネットワーク」からサーバを検索して「CUPS-PDF」(プリンタ名)を選択。

ドライバの選択画面で「HP Color LaserJet PS」を選択。

印刷すると /etc/cups/cups-pdf.conf で設定した場所に PDF が作成される。


PDF 出力の出来ない Windows OS にピッタリ。

が、糞遅いっす………(´・ω・`)

Raspberry Pi Model B+ (Plus)

Raspberry Pi Model B+ (Plus)

  • メディア: Tools & Hardware