[Haskell-cafe] Converting wiki pages into pdf

do_not_reply_to_this_address at t-online.de do_not_reply_to_this_address at t-online.de
Thu May 24 15:50:54 CEST 2012


I invested an enormous amount of time into this problem. Accordingly I 
got a very well working solution.

http://de.wikibooks.org/wiki/Benutzer:Dirk_Huenniger/wb2pdf
http://en.wikibooks.org/wiki/File:Haskell.pdf

I am happy If you find it useful.
Yours Dirk Hünniger

> Thu, 08 Sep 2011 05:36:44 -0700
> Hello all
> I am trying to write a Haskell program which download html pages from
> wikipedia   including images and convert them into pdf . I wrote a
> small script
>
> import Network.HTTP
> import Data.Maybe
> import Data.List
>
> main = do
>          x<- getLine
>          htmlpage<-  getResponseBody =<<  simpleHTTP ( getRequest x ) --
> open url
>          --print.words $ htmlpage
>          let ind_1 = fromJust . ( \n ->  findIndex ( n `isPrefixOf`) .
> tails $ htmlpage ) $ "<!-- content -->"
>              ind_2 = fromJust . ( \n ->  findIndex ( n `isPrefixOf`) .
> tails $ htmlpage ) $ "<!-- /content -->"
>              tmphtml = drop ind_1 $ take ind_2  htmlpage
>          writeFile "down.html" tmphtml
>
> and its working fine except some symbols are not rendering as it
> should be. Could some one please suggest me how to accomplish this
> task.
>
> Thank you
> Mukesh Tiwari
>



More information about the Haskell-Cafe mailing list