<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>davinci’s notebook &#187; DHW</title>
	<atom:link href="http://stargrads.net/blogs/davinci/tag/dhw/feed/" rel="self" type="application/rss+xml" />
	<link>http://stargrads.net/blogs/davinci</link>
	<description>everything is an experiment</description>
	<lastBuildDate>Mon, 21 Mar 2011 18:31:14 +0000</lastBuildDate>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Converting DigiMemo files to Jarnal format</title>
		<link>http://stargrads.net/blogs/davinci/2009/09/converting-digimemo-files-to-jarnal-format/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/09/converting-digimemo-files-to-jarnal-format/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 23:29:32 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[ACECAD]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[DHW]]></category>
		<category><![CDATA[DigiMemo]]></category>
		<category><![CDATA[digital notepad]]></category>
		<category><![CDATA[electronic notepad]]></category>
		<category><![CDATA[Jarnal]]></category>
		<category><![CDATA[journal]]></category>
		<category><![CDATA[Kevin Lindsey]]></category>
		<category><![CDATA[L2]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Little Wooden Boy]]></category>
		<category><![CDATA[note-taking]]></category>
		<category><![CDATA[notetaking]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Scalable Vector Graphics]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[ZIP]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=1759</guid>
		<description><![CDATA[
In this post, I describe how to convert the DigiMemo L2 digital notepad's proprietary DHW files to the format used by the open source Jarnal note-taking software.
]]></description>
			<content:encoded><![CDATA[<p><b>Update (Sept. 29, 2009)</b>: I got in touch with <a href="http://www.kevlindev.com/">Kevin Lindsey</a>, the author of <a href="http://www.kevlindev.com/blog/?p=58">the script</a> discussed below for converting DigiMemo DHW files to SVG format.  He&#8217;s <a href="http://github.com/thelonious/DM2SVG">put his code on github</a>, and written a <a href="http://www.kevlindev.com/blog/?p=73">new blog post</a> about it.</p>
<hr />
<p>For taking notes physically on paper, I use an <a href="http://www.acecad.com.tw/index.php?option=com_content&amp;view=article&amp;id=27&amp;Itemid=99&amp;lang=en">ACECAD DigiMemo L2</a> digital notepad (whom I have named <a href="http://www.thetick.ws/tvsk.html#littlewoodenboy">Little Wooden Boy</a>).<br />
<!--adsensestart--><br />
Because I use Linux primarily, I don&#8217;t use the <a href="http://www.acecad.com.tw/index.php?option=com_content&amp;view=article&amp;id=17&amp;Itemid=111">Windows-based software</a> provided by ACECAD.  Instead, I use <a href="http://www.dklevine.com/general/software/tc1000/jarnal.htm">Jarnal</a>, an open source note-taking application written in Java.</p>
<p>This poses a minor problem, as the DigiMemo products store their output in a proprietary ACECAD format called DHW<span id="more-1759"></span>.  Fortunately, <a href="http://www.kevlindev.com/">Kevin Lindsey</a> had already gone to the trouble of asking ACECAD for the specification of the DHW format, and better yet, he has even whipped up a Perl script to convert DHW files to the <a href="http://www.w3.org/Graphics/SVG/"><abbr title="Scalable Vector Graphics">SVG</abbr></a> open standard.</p>
<p>Jarnal&#8217;s <a href="http://www.dklevine.com/general/software/tc1000/jarnal-advanced.htm">file format</a> is in fact just a standard <a href="http://en.wikipedia.org/wiki/ZIP_(file_format)">ZIP</a> file containing a plain text configuration file and a number of SVG files, one for each page in the document.  So far, so good.  Unfortunately, Jarnal&#8217;s ability to read SVG files produced by other programs is not very robust.  In order to convert DHW files to SVG files which are readable by Jarnal, a number of changes have to be made to Kevin Lindsey&#8217;s original Perl script.</p>
<p>Note that the changes which I&#8217;ve made are specifically for the DigiMemo L2.  If you have a device with different dimensions, for example, you will have to tweak some of the parameters that I&#8217;ve used (such as the values of 924 and 714 that I&#8217;ve assigned to the virtual height and width of the drawing surface).  </p>
<p>First, download the script from Kevin Lindsey&#8217;s blog entry <a href="http://www.kevlindev.com/blog/?p=58">here</a>.  The file to download is named &#8220;DigiMemo.zip&#8221;.  Extract the file named &#8220;DigiMemo_SVG.pl&#8221;, and make the changes described in the following paragraphs.<br />
<!--adsensestop--><br />
In the &#8220;emit_header&#8221; subroutine, locate the following lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>133
134
135
136
137
138
139
140
141
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;">    <span style="color: #000066;">print</span> <span style="color: #000000; font-weight: bold;">STDOUT</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOF<span style="color: #339933;">;</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>svg viewBox<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;0 0 $width $height&quot;</span> fill<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;none&quot;</span> stroke<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;black&quot;</span> stroke<span style="color: #339933;">-</span>width<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;10&quot;</span> stroke<span style="color: #339933;">-</span>linecap<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;round&quot;</span> stroke<span style="color: #339933;">-</span>linejoin<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;round&quot;</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>rect width<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;$width&quot;</span> height<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;$height&quot;</span> fill<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;aliceblue&quot;</span><span style="color: #339933;">/</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
EOF
    emit_comment<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;id = $id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    emit_comment<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;version = $version&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    emit_comment<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;width = $width&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    emit_comment<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;height = $height&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    emit_comment<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;page type = $page_type&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And replace them with these ones:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;">	<span style="color: #000066;">print</span> <span style="color: #000000; font-weight: bold;">STDOUT</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOF<span style="color: #339933;">;</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;?</span>xml version<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;1.0&quot;</span> standalone<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;no&quot;</span><span style="color: #339933;">?</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;!</span>DOCTYPE svg PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD SVG 20010904//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd&quot;</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>svg width<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;714px&quot;</span> height<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;924px&quot;</span> xmlns<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/2000/svg&quot;</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>title<span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>Jarnal document <span style="color: #339933;">-</span> see http<span style="color: #339933;">://</span>www<span style="color: #339933;">.</span>dklevine<span style="color: #339933;">/</span>general<span style="color: #339933;">/</span>software<span style="color: #339933;">/</span>tc1000<span style="color: #339933;">/</span>jarnal<span style="color: #339933;">.</span>htm <span style="color: #b1b100;">for</span> details<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;/</span>title<span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>desc<span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>Jarnal Page Parameters<span style="color: #009900;">&#93;</span>
paper<span style="color: #339933;">=</span>Lined
lines<span style="color: #339933;">=</span><span style="color: #cc66cc;">35</span>
height<span style="color: #339933;">=</span><span style="color: #cc66cc;">924</span>
width<span style="color: #339933;">=</span><span style="color: #cc66cc;">714</span>
bg<span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span>
transparency<span style="color: #339933;">=</span><span style="color: #cc66cc;">255</span>
bcolor<span style="color: #339933;">=-</span><span style="color: #cc66cc;">1</span>
bgtext<span style="color: #339933;">=</span>false
bgfade<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span>
bgrotate<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span>
bgscale<span style="color: #339933;">=</span><span style="color: #cc66cc;">1.0</span>
bgid<span style="color: #339933;">=</span>none
bgindex<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span>
<span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;/</span>desc<span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
EOF</pre></td></tr></table></div>

<p>The Perl script will now generate SVG files with a header that Jarnal can read.  But we&#8217;re not done yet.  In the &#8220;emit_comment&#8221; subroutine, delete the following line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>154
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;">    <span style="color: #000066;">print</span> <span style="color: #000000; font-weight: bold;">STDOUT</span> <span style="color: #ff0000;">&quot;    &amp;lt;!-- $message --&amp;gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Finally, in the &#8220;emit_polyline&#8221; subroutine, locate the following lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>164
165
166
167
168
169
170
171
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;">    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@points</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$_</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">@$coords</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@points</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066;">print</span> <span style="color: #000000; font-weight: bold;">STDOUT</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOF<span style="color: #339933;">;</span>
    <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>polyline points<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;$data&quot;</span><span style="color: #339933;">/</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
EOF</pre></td></tr></table></div>

<p>And replace them with these ones:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;">    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@points</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">int</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">71400</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">8500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">100</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000066;">int</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">92400</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">11000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">@$coords</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$data</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;M&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot; L&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@points</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066;">print</span> <span style="color: #000000; font-weight: bold;">STDOUT</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOF<span style="color: #339933;">;</span>
    <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>path d<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;$data&quot;</span> stroke<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;black&quot;</span> stroke<span style="color: #339933;">-</span>width<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;0.6&quot;</span> fill<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;none&quot;</span><span style="color: #339933;">/</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>
EOF</pre></td></tr></table></div>

<p>Now the script will produce SVG files which are fully readable by Jarnal.  However, it still only converts one file (i.e., one page) at a time.  To produce a Jarnal document containing multiple pages, we&#8217;ll need to create some additional scripts.</p>
<p>Create a bash file named &#8220;digimemo-template&#8221; with the following content in &#8220;/usr/local/bin&#8221;, and give it execute permission:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$1&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: digimemo-template [filename]&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;$1.jaj&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ERROR: file <span style="color: #000099; font-weight: bold;">\&quot;</span>$1.jaj<span style="color: #000099; font-weight: bold;">\&quot;</span> exists.&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;/path/to/jarnal/templates/digimemo.jaj&quot;</span> <span style="color: #ff0000;">&quot;$1.jaj&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;File <span style="color: #000099; font-weight: bold;">\&quot;</span>$1.jaj<span style="color: #000099; font-weight: bold;">\&quot;</span> created.&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>The above assumes that you have a Jarnal template file named &#8220;digimemo.jaj&#8221; located in the &#8220;/path/to/jarnal/templates&#8221; subdirectory.  Change it as appropriate.  Now, running &#8220;digimemo-template <em>filename</em>&#8221; will create a Jarnal file named &#8220;<em>filename</em>.jaj&#8221; in the current directory.</p>
<p>Next, create a Perl script named &#8220;digimemo.pl&#8221; with the following content in &#8220;/usr/local/bin&#8221; and give it execute permission:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
<span style="color: #000000; font-weight: bold;">use</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Temp</span> <span style="color: #009966; font-style: italic;">qw/ tempdir /</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">@</span><span style="color: #000000; font-weight: bold;">ARGV</span> <span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;digimemo-template $ARGV[0]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$?</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$tempdir</span> <span style="color: #339933;">=</span> tempdir <span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;digimemo-XXXXXXXX&quot;</span><span style="color: #339933;">,</span> TMPDIR <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Creating temporary directory: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$tempdir</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #0000ff;">$file</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;*.</span>DHW<span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Converting &quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$file</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; &amp;gt; $tempdir/p$count.svg<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;DigiMemo_SVG.pl &quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$file</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; &amp;gt; $tempdir/p$count.svg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$count</span><span style="color: #339933;">++;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;zip -j $ARGV[0].jaj $tempdir/p*.svg<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;zip -j $ARGV[0].jaj $tempdir/p*.svg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Created new digimemo Jarnal file: $ARGV[0].jaj<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed to create new digimemo Jarnal file.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>        
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;digimemo.pl [filename]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Running the command &#8220;digimemo.pl <em>filename</em>&#8221; will convert all of the DHW files in the current directory to SVG format, and then bundle them up in a ZIP file named &#8220;<em>filename</em>.jaj&#8221;, which can now be opened using Jarnal.</p>
<p>Since Jarnal can output PDF files, this serves as a way of converting DHW files to that format as well.  </p>
<p>&#8211; davinci 11778</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=1759&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/09/converting-digimemo-files-to-jarnal-format/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

