dvipng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dvipng] Static/dynamic library for dvipng?


From: Jan-Åke Larsson
Subject: Re: [Dvipng] Static/dynamic library for dvipng?
Date: Thu, 01 Oct 2009 15:55:41 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080213)

Alex wrote:
> The next step would seem to be to use the dvipng command-line
> utility to convert this DVI to a PNG file. This is of course no problem
> for a GUI app, though somewhat inefficient I might think.

This is true, but you should remember that the overhead will be there in
any case, when calling TeX and when dvipng itself calls gs for image
inclusion.

> My main question is: is dvipng suitable to be used as a static/dynamic
> library for inclusion in other programs? (In addition, I would be
> curious to know whether it is possible to use a library rather than a
> stdio program for generating the DVI.)

There are no designed entry points, and above all no stable API. I could
perhaps design one, implement it, and learn how to release it as a
library, but I have preciously little time these days.

> I am presuming that both the DVI generator of TeX and the PNG generator
> of dvipng are designed to output solely to files. Still, if there is any
> way of circumventing this and doing things in-memory, that would be
> useful for me.

The DVI generator of TeX I do not know much about. I have been thinking
about named pipes for dvipng but this is a less portable solution.

The internals of dvipng does do everything in memory. Input of files
uses mmap for reading, and if mmap is not available, reads in the whole
file into memory. Output is via libgd in memory as a gdimage and as a
final step uses a gd function for writing to a file, IIRC there is one
for in-memory conversion to a PNG. So in principle it would be possible
to do everything in memory.

> A final small query: is compiling dvipng for Windows possible (given
> that it is my primary target platform), or perhaps via cygwin, if that's
> less painful? Using MiKTeX should make no difference, as I understand.

Dvipng is included in MiKTeX. And TeXLive under cygwin.

/JÅ


-- 
"We're working at the intersection of TeX (bizarre and, er, eccentric),
Emacs (bizarre and, er, eccentric) and GhostScript. Why expect
GhostScript to be any less bizarre and eccentric than the rest?"
   Nick Alcock, the preview-latex development team




reply via email to

[Prev in Thread] Current Thread [Next in Thread]