CentOS 6.8 の mknmz で "Unable to convert pdf file (maybe copying protection)"
○環境
- CentOS 6.8
- namazu-2.0.21
英語のPDFはうまく行くが、日本語のPDFが、mknmz で "Unable to convert pdf file (maybe copying protection)"と出てうまく行かない。
いろいろ調べたところ、CentOS6 の yum でインストール された poppler-util に含まれる
pdftotext/pdfinfo のバージョン表記が namazu の設定の想定外らしい。
従来は、xpdf に含まれていたためか、pdftotext/pdfinfoのバージョン表記は 3.0 等になっていたのだが、poppler-utils に含まれるようになって、バージョン表記が 0.12.4 などとなっている。
そのため、namazu の pdf filter でのオプションとミスマッチになっていた。
○対処
pdftotext のバージョンに関わらず、オプションを固定した。
/usr/local/share/namazu/filter/pdf.pl の 62,64~66,86,88~90行目をコメントアウト
61: if (util::islang("ja")) {
62: # if ($pdfconvver >= 1.00) {
63: @pdfconvopts = ('-q', '-raw', '-enc', 'EUC-JP');
64: # } else {
65: # @pdfconvopts = ('-q', '-raw', '-eucjp');
66: # }
85: if (util::islang("ja")) {
86: # if ($pdfinfover >= 2.02) {
87: @pdfinfoopts = ('-enc', 'EUC-JP');
88: # } else {
89: # @pdfinfoopts = ();
90: # }