MyTetra Share
Делитесь знаниями!
Как в Windows сделать из PDF картинку через Ghost Script
Время создания: 12.12.2011 12:23
Текстовые метки: ghost script, gswin32c
Раздел: Компьютер - Windows - Графика
Запись: xintrea/mytetra_syncro/master/base/13236782025qtj5yb6e2/text.html на raw.github.com

Вначале нужно скачать программу Ghost Script с сайта ghostscript.com и установить её. Затем надо скопировать файлы из каталога /bin, который находится по пути инсталляции, в каталог c:\windows\system32.

Затем можно воспользоваться командой

gswin32c.exe ^

-sDEVICE=pngalpha ^

-o output/page_%03d.png ^

-r600 ^

d:/path/to/your/input.pdf

или

gswin32c.exe -sDEVICE=pngalpha -o d:\page.png -r600 d:\input.pdf

- эта команда выдаст только перый лист PDF-файла

Here is a command that would convert your input PDF to a series of JPEGs (one file for each PDF page). I'm assuming Windows -- for Linux just replace the ^ by \ and gswin32c.exe by gs:

gswin32c.exe ^

-o "d:/path with spaces/to/output/dir/input_page_%03d.jpeg" ^

-sDEVICE=jpeg ^

-dJPEQ=95 ^

-r720 ^

-g5000x5000 ^

-dUseCropBox=true ^

"d:/path/to/input.pdf"

Explanation:

  • -dJPEGQ sets the JPEG quality. Accepts integer values in the range 0..100. Higher values create bigger files... (Ghostscript's default for JPEGQ is set to 75.)
  • -r720 sets a (rather high) resolution of 720dpi. Higher values create bigger files... (Ghostscript's default for its jpeg output device would be 72dpi.)
  • -g5000x5000 gives the file dimension in pixels. (Note: when decreasing the -r... value you MUST also accordingly decrease the -g... value to keep the same dimension in userspace inches or mm.)

You could also add -dPDFFitPage=true if that is useful for you.

 
MyTetra Share v.0.59
Яндекс индекс цитирования