Command Line Tool which is included in Astah installation folder enables you to export images and compare projects from Command-Line.
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
Kind | Note |
---|---|
all | All diagrams |
cl | Class Diagram |
uc | UseCase Diagram |
ucd | UseCase Description |
sc | Statemachine Diagram |
act | Activity Diagram |
seq | Sequence Diagram |
com | Communication Diagram |
cmp | Component Diagram |
dep | Deployment Diagram |
cs | Composite Structure Diagram |
fc | Flowchart |
dfd | Data Flow Diagram |
er | ER Diagram |
crud | CRUD |
mm | Mind Map |
rqd | Requirement Diagram |
rqt | Requirement Table |
tm | Traceability Map |
ignore -ref | Exclude reference projects |
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 ID | Specify 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 to | Folder where the image is exported to is “base folder and project file name. |
|
-t,--type [image type] | Format of images | png, jpg, svg, emf | PNG, JPEG, SVG, EMF(Enhanced Metafile) |