Page 1 of 1

Command-line use: exporting & printing

Posted: Thu Jul 30, 2009 8:21 pm
by lpaatero
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

Re: Command-line use: exporting & printing

Posted: Sat Jan 08, 2011 4:45 am
by bearkong
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(


Re: Command-line use: exporting & printing

Posted: Sun Jan 09, 2011 1:09 am
by lpaatero

(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!


Re: Command-line use: exporting & printing

Posted: Mon Sep 30, 2013 12:28 am
by Stephen
Hi :

Can I use gowrite command line on windows?



Re: Command-line use: exporting & printing

Posted: Thu Oct 03, 2013 9:02 pm
by lpaatero
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