0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PDFtoPNG.exeを使って、Windows10で日本語PDFファイルをPNG画像に変換する

Last updated at Posted at 2020-07-11

XpdfReader には、pdftopng.exe が付いてくるけども

Download the Xpdf command line tools:
Windows 32/64-bit: download (GPG signature)

そのまま日本語PDFに使っても、変換エラーになる

$ bin64\pdftopng.exe mydata.pdf out.png

Syntax Error: Unknown font tag 'F4'
Syntax Error (9891): No font in show
Syntax Error (9897): No font in show
Syntax Error (9902): No font in show
Syntax Error (9907): No font in show
Syntax Error (9911): No font in show
Syntax Error (9917): No font in show
Syntax Error (9922): No font in show
Syntax Error (9927): No font in show
Syntax Error (9933): No font in show

言語サポートパックを入れる

Download language support packages for Xpdf:
Japanese [updated 2017-Jul-25]
http://www.xpdfreader.com/download.html

$ cd bin64
$ mkdir japanese
$ (ここにダウンロードしたtar ballを展開)

xpdfrc コンフィグを記載する。絶対パスについては、適度に置き換えてください。
ここでは「MSゴシック」を指定しています。

$ vim bin64\xpdfrc

textEncoding UTF-8
psResidentFont @MS-Gothic MS-Gothic
fontFileCC Adobe-Japan1 C:\Windows\Fonts\msgothic.ttc

cidToUnicode Adobe-Japan1 C:\pkg\xpdftools\bin64\japanese\Adobe-Japan1.cidToUnicode
unicodeMap ISO-2022-JP C:\pkg\xpdftools\bin64\japanese\ISO-2022-JP.unicodeMap
unicodeMap EUC-JP C:\pkg\xpdftools\bin64\japanese\EUC-JP.unicodeMap
unicodeMap Shift-JIS C:\pkg\xpdftools\bin64\japanese\Shift-JIS.unicodeMap
cMapDir Adobe-Japan1 C:\pkg\xpdftools\bin64\japanese\CMap
toUnicodeDir C:\pkg\xpdftools\bin64\japanese\CMap

日本語PDFがちゃんと変換できるようになった。

$ bin64\pdftopng.exe mydata.pdf out.png

See also

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?