I understood you as needing to extract and display a PDF page on a web browser, and for that, the PDF::Extract module is on target. HTML::HTMLDoc::PDF would also be appropriate for that use. But for file format conversion, from PDF to HTML, which I'm now understanding is what you're trying to do, that's a different story, and a bit more difficult.
You could use PDF::Parse to disect the PDF file. But turning the output of PDF::Parse into HTML is work. Especially considering that some PDF files can be encrypted, rendering many of the PDF::Parse functions useless.
There are programs out there already that do the conversion for you, without requiring you to toil over trying to roll your own converter. this seems to be one possibility. There is another one here. The second one listed here is shareware with a free trial period. And Googling for "pdf to html conversion" turns up droves.
Of course they're not geared for doing it "on the fly". But it's also not a quick, on-the-fly type of process. Converting dynamically, on demand, would drive server load through the roof. It's something best done once, and for that, why not use an already completed solution?
Dave
"If I had my life to live over again, I'd be a plumber." -- Albert Einstein
| [reply] |
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.
| [reply] |
| [reply] |
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
| [reply] [d/l] |