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

In reply to Re: Re: Re: How can I convert a pdf to html with PDF::Extract? by davido
in thread Can I convert a pdf to html with PDF::Extract?? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.