hacker has asked for the wisdom of the Perl Monks concerning the following question:
Basically I have articles stored in a MySQL database which have some basic HTML formatting elements built into their body. These are not "webpages" per se, since there is no opening or closing <head> or <body> tags, just simple paragraph, bold, lists, and formatting elements. Here's a small example (note, this is the entire article as queried from the database):
<p class="fol">Here's some text that goes in the body of the article. It has some list items like this:</p> <ul> <li>List item one</li> <li>List item two</li> </ul>
When the user selects to read these articles, the articles is put between the "slices of bread" which adds my header and footer elements, according to the layout of the site, and the article body goes in middle.
What I'd like to do is provide a link at the bottom of each article that says "Convert to PDF" and have it link to a sub that can stuff this article into a PDF and present it to the user for view/download.
I have all of the mechanical bits of the query, response, display, etc. working, but need to know if it's possible with the various PDF modules (Text::PDF, PDF::Create, Data::Dbf2pdf, PDFLib) style modules take this article input and convert it into a usable PDF file, retaining the formatting that the HTML provides.
All of the examples I've seen deal with only plain text, not images or HTML-formatted text. I'm not opposed to doing some s/<li>/ o/ stuff where required, but I'd like to eliminate the need to do that kind of barbaric conversion.
edited: Wed Jul 24 16:30:15 2002 by jeffa - fixed closing li tag typo per author's request
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(wil) Re: HTML input to PDF output
by wil (Priest) on Jul 24, 2002 at 15:41 UTC | |
by Hero Zzyzzx (Curate) on Jul 24, 2002 at 16:05 UTC | |
by hacker (Priest) on Jul 24, 2002 at 16:16 UTC | |
by Hero Zzyzzx (Curate) on Jul 24, 2002 at 16:29 UTC | |
|
(jeffa) Re: HTML input to PDF output
by jeffa (Bishop) on Jul 24, 2002 at 15:50 UTC | |
by Hero Zzyzzx (Curate) on Jul 24, 2002 at 16:26 UTC | |
|
Re: HTML input to PDF output
by jsegal (Friar) on Jul 24, 2002 at 16:02 UTC | |
|
Re: HTML input to PDF output
by Stegalex (Chaplain) on Jul 24, 2002 at 21:43 UTC | |
|
Re: HTML input to PDF output
by nmerriweather (Friar) on Jul 25, 2002 at 01:17 UTC | |
by NaSe77 (Monk) on Jul 25, 2002 at 07:17 UTC | |
|
Re: HTML input to PDF output
by yogivan (Acolyte) on Jul 25, 2002 at 08:13 UTC |