I'm just starting to investigate using latex to generate an ebook with arabic snippets embedded in it, and I'm using the following simple document:
\documentclass{article}
\usepackage{arabtex}
\usepackage{utf8}
\begin{document}
Hello world
\setcode{utf8}
\begin{arabtext}
السَلامُ عَليكم
\end{arabtext}
Goodbye World!
\end{document}
Here's the output with pdflatex:

When I try converting to html, here is the garbled output:

Generated HTML source:
<!--l. 7--><p class="noindent" >Hello world
<span
class="xnsh-14"></span><span
class="xnsh-14">J</span><!--l. 13--><p class="indent" >
<span
class="xnsh-14"></span><span
class="xnsh-14"></span><!--l. 13--><p class="indent" >
<span
class="xnsh-14"></span><span
class="xnsh-14"></span> <!--l. 13--><p class="indent" >
<span
class="xnsh-14"></span> <span
class="xnsh-14"></span><span
class="xnsh-14">C</span> <!--l. 13--><p class="indent" >
<span
class="xnsh-14"></span> <span
class="xnsh-14"></span><span
class="xnsh-14">@</span>
<!--l. 16--><p class="indent" > Goodbye World!
What I want is to render the arabic as an image (that looks like the pdf-rendered version) and have that image in the html source. Something like:
<span>Hello world</span>
<img src="foo.png" />
<span>Goodbye World!</span>
What's the best way to tackle this issue? I'm completely new to latex but don't mind if the solution requires some programming for pre-processing on my end.
