[gs-devel] GhostScript PS to a Bitmap Objecto conversion
Ray Johnston
Ray.Johnston at Artifex.com
Sat Jul 21 12:08:13 PDT 2007
Hi Daniel,
Ghostscript can be used to convert PostScript to bitmaps in
a variety of formats. You proably want the bitmap to match
the bbox of the glyph, so you can use the 'bbox' device to
do that i.e., select the bbox device, feed the PS file to
Ghostscript and collect the result from stdout (or the
callout to the stdout hook). Then set select the device for
the desired output format (e.g., pbmraw), set the 'PageSize'
and then feed the PS to Ghostscript again.
The "iapi_run_string_..." functions can let you do this all
from a single invocation of Ghostscript, using 'selectdevice'
to switch devices and 'setpagedevice' (with appropriate operands)
to set the PageSize, HWResolution and OutputFile). You could
either send it PS for the entire formula or you can run glyphs
to it one by one and collect each glyph in its own bitmap file.
Good Luck,
Ray Johnston
------------------------------------------------------------------------
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.
>
> I would like to know if GhostScript API could give me a hand on this.
> Thanks.
> _______________________________________________
> gs-devel mailing list
> gs-devel at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel
>
More information about the gs-devel
mailing list