[links-list] Re: PDF in Textmode

Petr Baudis pasky at ucw.cz
Mon Nov 11 12:33:10 PST 2002

Dear diary, on Mon, Nov 11, 2002 at 09:11:39PM CET, I got a letter,
where Karel Kulhavy <clock at atrey.karlin.mff.cuni.cz> told me, that...
> > Dear diary, on Mon, Nov 04, 2002 at 02:34:56AM CET, I got a letter,
> > where "J. Korte" <jkorte at fastado.de> told me, that...
> > > Why don't you use the pdf to txt translation from google, instead of
> > > showing binary trash?
> > 
> > You can use Lua for that in ELinks, I believe ;-).
> How?

You place some code for that into follow_url_hook function - you want to scan
the url for kinda /.pdf$/ (we don't involve ourselves with content-types now -
that would require us to extend the hooks by load_url and provide some redirect
function; I say all the time that someone interested should redesign the Lua
API to be much more flexible ;), then you modify it to match the scheme:


Note that I believe that it would be much more ellegant and usable to use some
system tool for the conversion, like pdftohtml. You would pipe the document to
it (in pre_format_html ?!) and save the output. But I'm not sure how it would
work out in practice, it may not be ideal for too large documents. Do you want
to volunteer to extend the ELinks Lua API to permit better implementation of
this? ;-)

				Petr "Pasky" Baudis
This host is a black hole at HTTP wavelengths. GETs go in, and nothing
comes out, not even Hawking radiation.
                -- Graaagh the Mighty on rec.games.roguelike.angband
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/
Unsubscribe: send email to links-list-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the links-list mailing list