Command Line Tool which is included in Astah installation folder enables you to export images and compare projects from Command-Line.

section divider

Export image files


By using -image option with astah-commandw.exe (for Windows) or astah-command.sh (For Mac or Linux), you can export diagram images as PNG, JPEG, EMF or SVG. If you do not specify the image format, it exports in PNG format.

[Windows] Export all the diagrams in the C:\input\hoge.asta.file to C:\output in PNG

astah-commandw.exe -image er -f C:\input\hoge.asta -o C:\output

[Mac/Linux] Export all the diagrams in ~/input/hoge.asta file to ~/output in JPEG

astah-command.sh -image all -f ~/input/hoge.asta -o ~/output -t jpg
section divider

-image Options

Kind

Note

allAll diagrams
clClass Diagram
ucUseCase Diagram
ucdUseCase Description
scStatemachine Diagram
actActivity Diagram
seqSequence Diagram
comCommunication Diagram
cmpComponent Diagram
depDeployment Diagram
csComposite Structure Diagram
fcFlowchart
dfdData Flow Diagram
erER Diagram
crudCRUD
mmMind Map
rqdRequirement Diagram
rqtRequirement Table
tmTraceability Map
ignore -refExclude reference projects
section divider

Other options

Option

Description

Kind

Note

-dpi,–dpi [image dpi]Resolution (dpi)–Specify the dpi of image
Default is 96 in the System Properties ([Tools] – [System Properties] – [Image Export]. dpi 72 is the same size as it is displayed in the Diagram Editor.
-f,–file [target file]Target file
-id,–dgm_id [ids for target diagrams]Set IDSpecify Diagram’s IDs with a space between them. If you specify the ID, file names will be the ID’s instead of diagram names.
-o,–output [output]Base folder where this image is exported toFolder where the image is exported to is “base folder and project file name.
-t,–type [image type]Format of imagespng, jpg, svg, emfPNG, JPEG, SVG, EMF(Enhanced Metafile)