Command-line use: exporting & printing

Various tips, tricks and known issues

Moderator: lpaatero

Go liiton hallitus
Posts: 459
Joined: Fri May 21, 2004 12:20 pm
Location: Finland

Command-line use: exporting & printing

Postby lpaatero » Thu Jul 30, 2009 8:21 pm

GOWrite 2.3.41 implements updated command-line exporting & printing. Details are likely to change in later version. Any changes will be posted here.

In order to export, use commands like (output is to out subdirectory):
mkdir out
java -cp /path-to-jar/GOWrite.jar GOWritePrint -wizard wizard.dsx -export print.dsx -format format.dsx -graphics graphics.gex -output out myfile.sgf

Exporting is two phased:
1. Print&export wizard (-wizard wizard.dsx) divides file into diagrams. If option is removed from command line, this step is skipped.
2. Export of all diagrams in file is performed (-export print.dsx).

In order to print instead of export, replace -export command line switch with -print switch.

Settings and options

XML files wizard.dsx and print.dsx allow controlling of all wizard and exporting parameters.

Option -format format.dsx allows selecting output format, B&W and move sizes.

Option -graphics grahicss.gex can be used to configure graphics styles and layout. Normal gowrite can save these files: from layout and graphics options dialog go to manage.


Working sample files are in zip file attached to this posting. Parameters present in files should be quite easy to understand, some of them are commented.

Any feedback would be appreciated!

-- Lauri
Example of use
(3.54 KiB) Downloaded 444 times

Posts: 1
Joined: Sat Jan 08, 2011 4:40 am

Re: Command-line use: exporting & printing

Postby bearkong » Sat Jan 08, 2011 4:45 am

First, thank you for the great program.

Does this command-line use functionality work in Windows? I am using GoWrite2 version 2.3.34. I tried the command line export, but get an exception. I run it in Windows cmd prompt.

out is a subdir I created, and z01001.sgf is a simple sgf file.

C:\Program Files\GOWrite2>java -cp GOWrite.jar GOWritePrint -wizard wizard.dsx -export print.dsx -output out z01001.sgf
reading out
110107 213352.968 gowrite.sgf.SGFUtil log INFO: State C:\Program Files\GOWrite2\out not found
Exception in thread "main" java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getBestCursorSize(Unknown Source)
at gowrite.gui.GameView.loadCursor(
at gowrite.gui.GameView.<init>(
at GOWritePrint.wizard(
at GOWritePrint.executePrint(
at GOWritePrint.parseCommandLine(
at GOWritePrint.main(


Go liiton hallitus
Posts: 459
Joined: Fri May 21, 2004 12:20 pm
Location: Finland

Re: Command-line use: exporting & printing

Postby lpaatero » Sun Jan 09, 2011 1:09 am


(Discussion relating to 2.3.9 version of GOWrite)

It seems I have broken this, when doing unrelated things in quite different area. Problem is that Print wizard attempts (due to mistake) to initialize graphics system, but it is not allowed to have one.
I added corrected 2.3.40 JAR file to this post; I will remove it as soon as I have 2.3.41 ready.

Windows should not be the problem (even thou I did not have one to test right now.)

I also notice now that GOWrite seems to require one of libraries (lib/swing-layout-1.0.3.jar). It would make sense to use GOWrite.jar from installation location, as then it has this library automatically.

2.3.40 has some changes in the way options are stored in dsx files (compared to example above). Simplest way to get exactly desired configuration is to run print wizard and export something using desired settings. Then these setting can be copied from gowrite settings directory (.gowrite) directory to desired place. In example above
.gowrite/WizardPrintExport.dsx sould be copied to wizard.dsx
.gowrite/DialogExport.dsx should be copied to print.dsx

I will update first post bit later, so that it will contain complete instructions on one posting.

Hope this helps!

(1.75 MiB) Downloaded 426 times

Posts: 8
Joined: Mon Sep 23, 2013 8:59 am

Re: Command-line use: exporting & printing

Postby Stephen » Mon Sep 30, 2013 12:28 am

Hi :

Can I use gowrite command line on windows?



Go liiton hallitus
Posts: 459
Joined: Fri May 21, 2004 12:20 pm
Location: Finland

Re: Command-line use: exporting & printing

Postby lpaatero » Thu Oct 03, 2013 9:02 pm

I have not tested it lately; I believe it should work, however I do not have example command lines.

Please post support etc questions into support forum; then I get notification about those.

- Lauri

Return to “Tips & Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest