in reply to Re: Re: Re: How can I convert a pdf to html with PDF::Extract?
in thread Can I convert a pdf to html with PDF::Extract??

Hi, Can u give me a concrete answer on converting pdf to html . Decrypting pdf is not easy . Can I do it this way . Convert pdf to pod and then pod to html. But i m not sure whether there exists a module to convert pdf to pod . I will be thankful if u support ur answer with a few links where I can get some useful information . Thanks for ur previous help.
  • Comment on Re: Re: Re: Re: How can I convert a pdf to html with PDF::Extract?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: How can I convert a pdf to html with PDF::Extract?
by davido (Cardinal) on Nov 28, 2003 at 10:11 UTC
    pdf2html, or convert.pl.

    Completed solutions.

    (this site also has a Perl related discussion on the matter.)


    Dave


    "If I had my life to live over again, I'd be a plumber." -- Albert Einstein
      Thanks for the link, davido. I spent about 2 minutes searching and turned up dozens of commercial products to do it (many with trial periods), but nothing free. adobe also has an online form where you can enter a URL of a pdf file and they will translate it to html.

      Update: never mind, I thought davido had found actual downloadable perl code.

      Update: there was an open source tool that makes an image for each page; doubt that meets the OP's requirements, though.

      Update: here is a GPL pdf2html converter, written in C++.
      <joke>Now all you need is a C++ to perl converter.</joke>

      Hi, http://access.adobe.com:8088/ads-cgi/convert.pl When I click the convert file after uploading a pdf file then I get the html pages .But are these in encrypted form . Can't we get a downloadable Perl script which converts pdf2html or doc2pdf since I need them in my application . Thankyou !

        I am quite sure that the Perl script used by Adobe is merely a gateway to the real conversion program, which is most likely not written in Perl but in C (or even C++). But as Adobe is selling PDF tools, I would advise you to enquire them directly about the price of a solution from them.

        perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Re: Re: Re: Re: How can I convert a pdf to html with PDF::Extract?
by Corion (Patriarch) on Nov 28, 2003 at 10:06 UTC

    Forget about it.

    That's the simplest answer I can give you, if your general goal is to convert arbitrary PDF to HTML pages. PDF is an application of PostScript, a programming language, and to properly convert PostScript output to HTML, you will have to write a PostScript renderer like GhostScript, something which is not easy. This is why you won't find any "general" application to convert PDF to HTML.

    If you only have a very specific class of PDF files, like, say, the output of exactly one application, then you might be able to use some of the above mentioned modules to extract the data form the PDF and then use that data to fill an HTML template to produce HTML files.

    Even this possible solution is not easy, and personally, I wouldn't bother with it, as PDF readers are already available for most platforms people tend to read stuff on.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web