[gs-devel] GhostScript PS to a Bitmap Objecto conversion

Ralph Giles giles at ghostscript.com
Sat Jul 21 11:55:23 PDT 2007


On Sat, Jul 21, 2007 at 02:21:55PM -0400, Daniel Antonio Peraza Cedrez wrote:

> Hi, I'm looking for a Qt wiget that allows me to display LaTeX
> formulae parsed from a Text Field. I have not found any results yet.
> Now I am thinking to write my own, and my basic idea is to use LaTeX
> compiler to write a PostScript file with the parsed TeX fomula, and
> then convert it to any Bitmap-like object, instead of an image file.

Yes, Ghostscript can certainly to this, although properly cropping 
formulae so the whitespace is correct can be difficult. You can
call Ghostscript from a shell to convert a ps file to a png or other 
bitmap, or do it in memory from the shared library build. 

See http://ghostscript.com/doc/current/API.htm for an overview of the 
second method.

The other method commonly used is to convert the LaTeX to MathML, and 
then render that. There's GTK widget for MathML, but all I found for QT 
was the suggestion of embedding Mozilla, which is a much heavier weight 
solution than Ghostscript.

HTH,
 -r




More information about the gs-devel mailing list