忍者ブログ
  • 2019.09
  • 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
  • 2019.11
UbuntuでCUPSを用いて自動命名印刷
CUPSのいつもの設定

■/etc/cups/cupsd.conf
...
# Restrict access to the admin pages...
<Location /admin>
  Require user @SYSTEM
  Order allow,deny
</Location>
...

■cups-pdfのインストール
sudo apt install cups-pdf

■/etc/cups/cups-pdf.conf
...
### Key: Out (config)
##  CUPS-PDF output directory 
##  special qualifiers: 
##     ${HOME} will be expanded to the user's home directory
##     ${USER} will be expanded to the user name
##  in case it is an NFS export make sure it is exported without
##  root_squash!
##  on Ubuntu, the cupsd AppArmor profile needs to be updated
##  to match the output path as per instructions in LP:147551
### Default: /var/spool/cups-pdf/${USER}

Out${HOME}
...
 ### Key: GSCall (config)
 ## command line for calling GhostScript (!!! DO NOT USE NEWLINES !!!)
 ## MacOSX: for using pstopdf set this to %s %s -o %s %s
 ### Default: %s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="%s" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f %s 
GSCall /usr/local/bin/cups-pdf-common %s %s "%s" %s 
 ...

■/usr/local/bin/cups-pdf-common
#!/bin/bash
export MY_GS=$1
export MY_VER=$2
HOME=$(dirname "$3")
USER=$(basename ${HOME})
export MY_IN=$4
export MY_OUT=$(basename "$3")

execpath=~/bin/cups-pdf
if [ -f ${execpath} ]
then
	${execpath}
fi

■~/bin/cups-pdf
#!/bin/bash

#Ps2PDF
${MY_GS} -q -dCompatibilityLevel=${MY_VER} -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="${HOME}/PDF/$(date +%Y%m%d_%H%M%S.%N)_${MY_OUT}" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f ${MY_IN}
PR
【2018/12/17 00:01 】 | Ubuntu | 有り難いご意見(0)
                                    
ibusでAnthyを使う
■インストール
# apt install anthy ibus-anthy

■設定
1. ibus用設定を開く
$ ibus-setup
2. 「Input Method」にAnthyを追加する。
【2018/12/10 21:11 】 | Ubuntu | 有り難いご意見(0)
                                    
| ホーム |