@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

= Kindle用にフォントを埋め込む

[2010-12-07 13:10:23]

Kindleで日本語PDFを読むために - 日記を書く [・w・] はやみずさんみてメモがてらシェルスクリプトにした.

pdf2kindle とか言う名前で保存してchmod +xね.

#!/bin/sh
if [ $# -lt 1 ]
then
    echo Usage: pdf2kindle input.pdf [output.pdf]
else
    pdf2ps $1 tmp.ps
    ps2pdf -dSubsetFonts=true -dEmbedAllFonts=true tmp.ps tmp.pdf
    if [ "$2" != "" ]
    then
        OUT=$2
    else
        cp $1 $1~
        OUT=$1
    fi
    mv tmp.pdf $OUT
fi

でも,ghostscriptが

$ gs
GPL Ghostscript  9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Unrecoverable error: syntaxerror in token
Operand stack:
    --nostringval--  --nostringval--
sfopen: gs_parse_file_name failed.
sfopen: gs_parse_file_name failed.
  ./base/gsicc_manage.c:706: gsicc_open_search(): Could not find lab.icc 
| ./psi/zusparam.c:805: set_lab_icc(): cannot find default lab icc profile

こんなエラー吐いてて動かないからアップデート待ち.まーまだKindle買ってないからまだいいんだけど.

#583738 - ghostscripts pdftoraster fails printing from gtk apps - Debian Bug report logsこれによるとアップデートされる気がするんやけどなー

% locate lab.icc
/opt/local/share/ghostscript/9.00/iccprofiles/lab.icc
/opt/local/var/macports/software/ghostscript/9.00_4/opt/local/share/ghostscript/9.00/iccprofiles/lab.icc

lab.iccそのものはあるんやけど,また別の問題?