*[[Ghostscript:http://www.ghostscript.com/]] [#odb09bf1]
*[[Ghostscript:https://www.ghostscript.com/]] [#odb09bf1]

#ref(http://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Ghostscript.svg/200px-Ghostscript.svg.png,right,around,nolink,Ghostscript)
Ghostscript は [[PostScript]]/[[Portable Document Format (PDF)>PDF]] インタプリタです.
PostScript/PDF ファイルを読み込んで,画面やプリンタや色々な形式のファイルに出力できます.
詳しくは次のページをご覧ください.

&color(White,#5F2F2F){  ''◆CONTENTS◆''  };&br;
-[[Ghostscript Website:https://www.ghostscript.com/]]
-[[ghostscript.com Mailing Lists:https://ghostscript.com/mailman/listinfo/]]
--[[The gs-bugs Archives:https://ghostscript.com/pipermail/gs-bugs/]]
--[[The gs-devel Archives:https://ghostscript.com/pipermail/gs-devel/]]
-[[Welcome to Ghostscript — Ghostscript 10.04.0 documentation:https://ghostscript.readthedocs.io/]]
--https://ghostscript.readthedocs.io/_/downloads/en/latest/pdf/

----
#contents
----

*Ghostscript とは [#a116e094]

Ghostscript は PostScript/Portable Document Format (PDF) インタプリタです。~
PostScript/PDF ファイルを読み込んで,画面やプリンタや色々な形式のファイルに出力できます。~
詳しくは次のページをご覧ください。~
**お知らせ [#c2f53cec]

-[[Ghostscript Website:http://www.ghostscript.com/]]
-[[Ghostscript, GhostPCL, GhostXPS and MuPDF Downloads Page:http://www.ghostscript.com/download/]]
-[[SourceForge.net: Ghostscript:http://sourceforge.net/projects/ghostscript/]]
-[[ghostscript - Ghostscript document rendering and conversion - Google Project Hosting:https://code.google.com/p/ghostscript/]]
-[[ghostscript.com Mailing Lists:http://ghostscript.com/mailman/listinfo/]]
--[[The gs-bugs Archives:http://ghostscript.com/pipermail/gs-bugs/]]
--[[The gs-devel Archives:http://ghostscript.com/pipermail/gs-devel/]]
-http://downloads.ghostscript.com/public/
-http://sourceforge.net/projects/ghostscript/files/GPL%20Ghostscript/
--http://ftp.jaist.ac.jp/pub/sourceforge/g/gh/ghostscript/GPL%20Ghostscript/
--ftp://ftp.jaist.ac.jp/pub/sourceforge/g/gh/ghostscript/GPL%20Ghostscript/
-https://code.google.com/p/ghostscript/downloads/list
-[[Ghostscript.NET:https://github.com/jhabjan/Ghostscript.NET]]
-[[Ghostscript.NET - Home:http://ghostscriptnet.codeplex.com/]]
-[[Ghostscript Studio - Home:https://ghostscriptstudio.codeplex.com/]]
Ghostscript 10.02.0 (2023-08-30) 以降に更新してください。
Ghostscript 10.01.2 (2023-06-21) およびそれ以前には,脆弱性が存在します。

**お知らせ [#c2f53cec]
-[[PDFを処理する「Ghostscript」にRCE脆弱性 - アップデートで修正:https://www.security-next.com/149859]]
-[[Ghostscript においてパイプ処理の検証不備により任意のコードが実行可能となる脆弱性(Scan Tech Report):https://scan.netsecurity.ne.jp/article/2023/10/11/50061.html]]

Ghostscript 9.14 はハイパーリンクが動作しないので,最新版に更新してください.~
Ghostscript 9.54.0 (2021-03-19),9.53.3 (2020-10-01),9.52 (2020-03-19),9.50 (2019-10-15) には,任意のコマンド実行が可能な脆弱性が存在します。

-[[pdfwrite - fix Named destinations with Names tree:http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=c79b0ee1dbc1cbbcbe406abd4bc47f617ed5cb2c]]
-[[Bug 695162 – Internal hyperlinks lost when converting to pdf:http://bugs.ghostscript.com/show_bug.cgi?id=695162]]
-[[Bug 695175 – can't save PDF file if compiled with hyperref packages:http://bugs.ghostscript.com/show_bug.cgi?id=695175]]
-[[Hyper Link fails in gs-9.14:http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1292]]
-[[[tex-live] Links fails in latex->dvips after update of tlgs.win32:http://tug.org/pipermail/tex-live/2014-April/thread.html#35059]]
-http://tug.org/pipermail/tex-live/2014-May/035415.html
-[[Ghostscript: CVE-2021-3781:https://ghostscript.com/CVE-2021-3781.html]]
-[[Ghostscriptの任意のコマンド実行が可能な脆弱性(CVE-2021-3781)に関する注意喚起:https://www.jpcert.or.jp/at/2021/at210039.html]]

Ghostscript 8.71 およびそれ以前の Ver. には脆弱性が存在するので,最新版に更新してください.~
Ghostscript 9.27 (2019-04-04) およびそれ以前には,アクセス制限回避の脆弱性が存在します。

-[[Ghostscript における任意の PostScript コマンドを実行される脆弱性:http://jvndb.jvn.jp/ja/contents/2010/JVNDB-2010-003612.html]]
-[[Ghostscriptに脆弱性--不正なファイルでDoS攻撃やコード実行の危険:http://japan.cnet.com/news/business/20418937/]]
-[[JVNVU#644319: Ghostscript の TrueType bytecode interpreter に脆弱性:http://jvn.jp/cert/JVNVU644319/]]
- TeX Live 2019 に含まれるいくつかのツールは Ghostscript 9.50 で起きた仕様変更に対応できていない場合があります(例:dvisvgm → [[commit 7b93a91:https://github.com/mgieseki/dvisvgm/commit/7b93a9197b69305429183affd24fa40ee04a663a]],gsftopk → [[forum:2756#p16126]])。TeX Live 2020 で修正されました。

GSview は CTAN から提供されなくなりました.~
GSview 以外では SumatraPDF や PS_View でも PS ファイルを表示することが可能です.~
- gs-9.50 を使うと [[dviout]] で EPS 画像が表示できない問題が発生します。gsx: を
c:\path_to_gs\gs9.50\bin\gswin32c.exe -dDELAYSAFER
に書き換えると表示できるようになります。(path_to_gs はお使いの環境の Ghostscript のパスに従ってください。)

-[[GSview is no longer avail­able from CTAN: it should be re­trieved from its home page.:http://www.ctan.org/pkg/gsview]]
// gs-9.50 で hyperref のリンク枠線が太くなる? https://tex.stackexchange.com/questions/524044

**動作環境 [#e8b195dc]
// gs-9.50 で .setpdfwrite オペレータが deprecated とマークされた。
// ちなみに .dashpath オペレータが削除されたのは gs-9.22 の模様。

Windows, OS X, Linux などの UNIX 互換 OS
// gs-9.50 で XeTeX での pstricks も失敗する。以下で対応。
// (1) dvipdfmx.cfg の変更 (r52766)
// (2) (x)dvipdfmx のソース spc_dvips.c の変更 (r52765)

**License [#g7897d81]
// gs-9.27 は下記のとおり bounding box の計算にバグがあり,より深刻なためオススメしない。

[[GNU Affero General Public License (AGPL):http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=COPYING;hb=HEAD]], [[Artifex Commercial License:http://www.artifex.com/page/licensing-information.html]]
-[[JVN#52486659: Ghostscript におけるアクセス制限回避の脆弱性:https://jvn.jp/jp/JVN52486659/]]
-[[JVNDB-2019-012236 - JVN iPedia - 脆弱性対策情報データベース:https://jvndb.jvn.jp/ja/contents/2019/JVNDB-2019-012236.html]]

最新版の Ghostscript のライセンスは GNU Affero General Public License (AGPL) ですが,過去のバージョンには [[AFPL:http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=COPYING.AFPL;hb=HEAD]] 版の Ghostscript があります。~
AFPL 版は商業的な配布に制限があります。~
このあたりの事情は,ちょっと古いですが,Ghostscript の作者
[[L. Peter Deutsch>Wikipedia:L_Peter_Deutsch]] の次のインタビュー記事をご覧ください。
-[[L. Peter Deutsch in conversation with Stig Hackvän [Internet Archive]:http://web.archive.org/web/20041013082602/http://devlinux.org/deutsch-interview.html]]
Ghostscript 9.27 (2019-04-04) は, pdfcrop がおかしくなる問題が発生します。
-commit [[06c920713e11bce9bd541bbf9bf294b2ba16aee8:http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=06c920713e11bce9bd541bbf9bf294b2ba16aee8]]
で修正されたようです。--> pdfcrop in gs-9.27 ([[forum:2622]])
-[[pdfcrop fails with gs9.27 · Issue #63 · ho-tex/oberdiek · GitHub:https://github.com/ho-tex/oberdiek/issues/63]]
-Debian GNU/Linux では ghostscript (9.27~dfsg-2) で修正されました。--> [[#927429 - ghostscript: incorrect bbox is produced in pdfcrop - Debian Bug report logs:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927429]]

**リリース情報 [#jbfe1b2f]
-http://git.ghostscript.com/?p=ghostpdl.git;a=tags
-[[Ghostscript: News:http://www.ghostscript.com/News.html]]
// gs-9.27 の他の仕様変更:GS_PDF_ProcSet オペレータの削除
// https://github.com/mgieseki/dvisvgm/issues/108#issuecomment-496382796

を参照.
// gs-9.27 で xdvi 22.87.03 で EPS 画像が表示されない → TeX Live r51707 で対処
// http://takeno.iee.niit.ac.jp/~shige/unix/memo/unix-memo.html#20190924

**ChangeLog [#ua2f6680]
//-[[git.ghostscript.com Git:http://git.ghostscript.com/]]
-[[git.ghostscript.com Git - ghostpdl.git/summary:http://git.ghostscript.com/?p=ghostpdl.git]]
--[[コミットログ:http://git.ghostscript.com/?p=ghostpdl.git;a=shortlog]]
**動作環境 [#e8b195dc]

Ghostscript 9.05 で日本語 OpenType フォントに関するバグが修正されたようです.
 
-[[更新履歴[Mac OS X バイナリ] - マスクメロン:http://www.muskmelon.jp/?p=360]]
Windows, macOS, Linux


**縦書きに関して [#o39e11da]
GNU Ghostscript 7.07 は日本の gs-cjk の寄与を含み,和文の扱い (縦書き) に優れています。~
残念ながら Ghostscript 8 以降ではこれが削除されてしまいました.~
Ghostscript 7.07 と比べて,CJK (中国語・日本語・韓国語)の縦書きへの対応が不充分です.~
CID フォントや Windows API を使った日本語の表示はできます.~
Ghostscript 7.07 には脆弱性が存在するので縦書きが必要ない場合は最新版の Ghostscript を使用してください。~

[[''Ghostscript 10.03.0'' がリリースされました。&br;&br;※ IPAフォントを指定した cidfmap を使って日本語データが問題なく印刷できることを確認しました。&br;$ gs /usr/share/ghostscript/10.03.0/examples/cjk/gscjk_aj.ps:https://twitter.com/jw_abekyun/status/1765766044860432515]]

//Ghostscript 9.22 (2017-10-04) 以降は日本語の縦書き PostScript ファイルがうまく表示できるようです。([[gs-9.22:https://okumuralab.org/tex/mod/forum/discuss.php?d=2276]])

//GNU Ghostscript 7.07 は日本の gs-cjk の寄与を含み,和文の扱い(縦書き)に優れています.
//残念ながら Ghostscript 8 以降ではこれが削除されてしまいました.
//Ghostscript 7.07 と比べて,CJK(中国語・日本語・韓国語)の縦書きへの対応が不充分です.
//CID フォントや Windows API を使った日本語の表示はできます.
//Ghostscript 7.07 には脆弱性が存在しますので,縦書きが必要ない場合は最新版の Ghostscript を使用してください.


**フロントエンド [#ka477802]
Microsoft Windows では GSview や PS_View,UNIX 互換 OS では gv という Ghostscript のフロントエンドがあります。~
これらはいずれも背後で Ghostscript を動かしています。~

//*不具合 [#o389845b]
Microsoft Windows では [[SumatraPDF]],  macOS では [[Evince]], [[Okular]],  Linux では [[Evince]], [[Okular]], [[zathura]], [[qpdfview]] などの Ghostscript のフロントエンドがあります.
これらはいずれも背後で Ghostscript を動かすことにより,PostScript ファイルを表示することができます.

*Ghostscript for Microsoft Windows [#w33eec77]

[[Ghostscript/Windows]] を参照.
//**不具合 [#o389845b]

*Ghostscript for OS X [#hc13e1b1]

[[Ghostscript/OS X]] を参照.
**各 OS 特有の Ghostscript 情報 [#w33eec77]

*Ghostscript for Linux [#xff4aa84]
-[[Ghostscript/Windows]]
-[[Ghostscript/macOS]]
-[[Ghostscript/Linux]]

[[Ghostscript/Linux]] を参照.

*使い方 [#odaff2e6]
**使い方 [#odaff2e6]

[[Ghostscript/使い方]] を参照.

*関連リンク [#we8f22aa]

**関連リンク [#we8f22aa]

-[[CJK fonts and Ghostscript integration:http://www.preining.info/blog/software-projects/cjk-fonts-ghostscript/]]
-[[GhostScriptあれこれ:http://xanadu62.blogspot.jp/2014/11/ghostscript_22.html]]
-[[ghostscriptのコマンドライン引数:http://sage-t.tumblr.com/post/71333720989/ghostscript]]
-[[Beyond Linux® From Scratch (Ghostscript):http://lfsbookja.sourceforge.jp/BLFS/svn.ja/pst/gs.html]]
-[[ghoastscriptの日本語文字化けについて。:http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q11121158676]]
-[[ghoastscriptの日本語文字化けについて.:http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q11121158676]]
-[[Ghostscript についてちょっとだけ:http://d.hatena.ne.jp/naruoga/20130110/1357827274]]
-[[Windows 用 Ghostscript と GSview のインストール:http://www.nsknet.or.jp/~tony/TeX/install/win/gs.htm]](トニイさん)
-[[Data storage for gs-cjk project:http://www.aihara.co.jp/~taiji/gyve/]] (山田さん)
-[[情報工学特別講義 II:http://www.nls.ics.saitama-u.ac.jp/~tohru/Lectures/2003/SLICS2/]]
--[[A Guide to gs-cjk Project:http://www.nls.ics.saitama-u.ac.jp/~tohru/Lectures/2003/SLICS2/PDFs/guide_to_gs-cjk.distil.pdf]] guide_to_gs-cjk.distil.pdf (PDF)
--[[A Guide to gs-cjk Project:http://www.nls.ics.saitama-u.ac.jp/~tohru/Lectures/2003/SLICS2/PDFs/guide_to_gs-cjk.slide.distil.pdf]] guide_to_gs-cjk.slide.distil.pdf (PDF)
-http://web.archiveorange.com/archive/v/vAtTlka8G6c0C2UJ4Kkr#GkcD2kaa2gXJUkc
-[[Data storage for gs-cjk project:https://www.aihara.co.jp/~taiji/gyve/]](山田さん)
-[[情報工学特別講義 II:http://www.hisenkei.net/~tohru/Lectures/2003/SLICS2/]]
--[[A Guide to gs-cjk Project:http://www.hisenkei.net/~tohru/Lectures/2003/SLICS2/PDFs/guide_to_gs-cjk.distil.pdf]] guide_to_gs-cjk.distil.pdf (PDF)
--[[A Guide to gs-cjk Project:http://www.hisenkei.net/~tohru/Lectures/2003/SLICS2/PDFs/guide_to_gs-cjk.slide.distil.pdf]] guide_to_gs-cjk.slide.distil.pdf (PDF)

//* Comment [#z51688d5]
//- 「PDF への欧文用フォントの埋め込み制御」で書き換えすべきファイルが、gs9.00、8.70では"Resource/Init/gs_pdfwr.ps"に移動しています。 -- 13th-note &new{2010-10-12 (火) 15:51:13};
***License [#g7897d81]

[[GNU Affero General Public License (AGPL), Artifex Commercial License:http://artifex.com/licensing/]]

現在の Ghostscript のオープンソースライセンスは GNU Affero General Public License (AGPL) です.
((過去の Ghostscript のバージョンには [[AFPL>Wikipedia:Aladdin_Free_Public_License]] 版があります.AFPL 版は商業的な配布に制限があります.このあたりの事情は,古いですが,Ghostscript の作者 [[L. Peter Deutsch>Wikipedia:L_Peter_Deutsch]] の次のインタビュー記事をご覧ください:[[L. Peter Deutsch in conversation with Stig Hackvän [Internet Archive]:http://web.archive.org/web/20041013082602/http://devlinux.org/deutsch-interview.html]]))

***リリース情報 [#jbfe1b2f]

-http://git.ghostscript.com/?p=ghostpdl.git;a=tags
-[[Ghostscript: Releases:https://www.ghostscript.com/releases.html]]

***ChangeLog [#ua2f6680]

//-[[git.ghostscript.com Git:http://git.ghostscript.com/]]
-[[git.ghostscript.com Git - ghostpdl.git/summary:http://git.ghostscript.com/?p=ghostpdl.git]]
--[[コミットログ:http://git.ghostscript.com/?p=ghostpdl.git;a=shortlog]]

//**Comment [#z51688d5]
//
//- 「PDF への欧文用フォントの埋め込み制御」で書き換えすべきファイルが,gs9.00,8.70では"Resource/Init/gs_pdfwr.ps"に移動しています. -- 13th-note &new{2010-10-12 (火) 15:51:13};
//- 「PDFへの欧文用フォントの埋め込み制御」でgs_pdfwr.psについて/.standardfontsを書き換えずに,"/.distillersettings mark"の下の"/default mark"の下の設定(8.71だと104~130行目,最後の空行も含む)をコピーして/NeverEmbedの行を変更したpsfontsembedという新しい設定を作り,dvipdfmx -D "ps2pdf -dPDFSETTINGS=/psfontsembed %i %o"としても良いようです. -- stamura &new{2010-10-21 (木) 12:00:51};
//- 先ほどは上記のように書きましたが,その後調べてみると/AlwaysEmbed, /NeverEmbedがうまく働かない問題は"http://ghostscript.com/pipermail/gs-cvs/2009-March/009170.html"で解決されているようです.ただし,gs_pdfwr.psのdefaultでは/NeverEmbedが基本14フォントが指定されているので/AlwaysEmbedは効かず,基本14フォントから埋め込みたいフォントを除いたリストを/NeverEmbedに指定するということになりますが. -- stamura &new{2010-10-21 (木) 13:41:39};
//
//#COMMENT
//#comment