LoginSignup
8
7

More than 5 years have passed since last update.

PlantUMLの成果をPDFにする

Last updated at Posted at 2016-12-04

0. 問題点

PlantUMLはAtomやEclipseのPluginが充実していて素晴らしいのだけど、エディタやWikiが無いと見れないのはもったいない。PDF化すれば成果物をエンジニア以外とも簡単に共有できる。
しかし公式サイトに記載されているPDF化手順は面倒な上に、日本語変換がちゃんとできないという問題点がある。
http://plantuml.com/pdf

1. 解決方法:概要

PlantUMLでいきなりPDFを生成するのではなく、一度SVGを生成してから、InkscapeでPDFを生成する。

2. 解決方法:詳細

2-1. 環境構築

1.適当なCentOSマシンを用意し、JREまたはJDKをインストールする。

2.platuml.jarを準備する。 ※シーケンス図以外を作図する場合はGraphvizも必要。

$ wget http://sourceforge.net/projects/plantuml/files/plantuml.jar/download
$ mv download plantuml.jar

3.IPAフォントをインストールする

$ sudo yum -y install ipa-gothic-fonts ipa-mincho-fonts ipa-pgothic-fonts ipa-pmincho-fonts

4.Inkscapeをインストールする

$ sodo yum -y install inkscape

2-2. PDF化手順

PlantUMLでSVGを生成して、inkscapeでPDF化するだけ。

$ java -jar plantuml.jar -svg 2-1_new.txt
$ inkscape -f 2-1_new.svg -A 2-1_new.pdf

シェルスクリプトでこの2行を実施するコマンドを作っても良いし、
MakeやRakeで一括変更するようにしても良い。

8
7
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
8
7