-
Notifications
You must be signed in to change notification settings - Fork 18
Node.js command line interface
Geierlein may be used right on the command line using Node.js. To use it the Node.js packages iconv and optimist need to be installed, which are not part of the Geierlein distribution.
In order to do so, simply type
npm install .
As soon the Node.js environment is set up properly, you can run the geierlein binary like so:
In order to send a tax return in test-mode, type
bin/geierlein -t -f doc/examples/ustva
In order to not flag the transmission as test case just leave away the -t flag (be careful, there are no further safety questions):
bin/geierlein -f doc/examples/ustva
The transmission protocol is simply output to standard output. Hence in order to save the protocol (which you really always want to do), redirect the output:
bin/geierlein -f doc/examples/ustva > proto/2012-04.xml
The document is a XML document absolutely referencing a stylesheet converting it to XHTML and should be printable with pretty much any modern browser. Besides that you might want to use tools like xsltproc to immediately do the XML to XHTML processing and store that instead.
xsltproc chrome/content/xsl/ustva.xsl proto/2012-04.xml > proto/2012-04.html
Google Chrome has a pretty much restrictive security model with regard to the file protocol (which is used to access local files). It prohibits access to files (i.e. the stylesheet) if it’s located in a different folder then the XML file. Start Chrome with the --allow-file-access-from-files flag to allow so anyhow.
If you want to generate a PDF for printing from the command line, you can use WeasyPrint:
weasyprint -f pdf proto/2012-04.html proto/2012-04.pdf
The command line application is capable of processing files stored with the XUL application. This is you can initially create a return using the XUL application, store it to disk, then periodically update this file using whatever text-processing tool and transmit from the command line.