Information


PDFをJPGに変換する

  •    2010年10月30日(土) 16:51 JST 閲覧件数 1,398
PDFファイルをJPG画像に変換するのはGhostscriptだけでOK。

(1) pdf2jpg.batファイルを新規作成(中身は下記コードを1行で)
@C:\gs\gs8.71\bin\gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -r300 -sOutputFile=%1_%%04d.jpg %1

(2) pdf2jpg.batをコマンドプロンプトで実行。

2ページあるsample.pdfをjpgに変換する例
C:\gs>pdf2jpg.bat sample.pdf
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 2.
Page 1
Page 2



1ページにつき1個のjpgファイルが生成される。
 
sample.pdf_0001.jpg
sample.pdf_0002.jpg