XP is just a number | |
PerlMonks |
HTML input to PDF outputby hacker (Priest) |
on Jul 24, 2002 at 15:35 UTC ( [id://184895]=perlquestion: print w/replies, xml ) | Need Help?? |
hacker has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on a news "portal" site for one of my public Open Source projects, and have a question about PDF output. 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):
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
Back to
Seekers of Perl Wisdom
|
|