Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Using script to print out a html file

( #25201=categorized question: print w/ replies, xml ) Need Help??
Contributed by Anonymous Monk on Jul 31, 2000 at 07:28 UTC
Q&A  > CGI programming


Description:

I am not sure whether its possible.
The script i want to create is one that is able to print
the html file, not the source code but the output i will
see on my browser.

Thanks.

Answer: Using script to print out a html file
contributed by ColtsFoot

If you just want yo see the text that is contained
in your HTML then you could try parsing your document
using HTML::Parser

$p = HTML::Parser->new(); $p->parse_file('Your_html.html');
and then use HTML::FormattedText and the format method to
get your output. Hope this is of help
Answer: Using script to print out a html file
contributed by Corion

It is in general a quite hard task to render HTML like "your" browser, as many browsers have quite different opinions on how to "correctly" render HTML. There are modules that do this for Perl, like HTML::Format, that can produce Postscript or ASCII text from HTML source, but if you want something in the quality of IE 5, supporting frames etc., you have to use IE 5 to print it.

In general, Perl is the wrong hammer for this nail.

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (6)
    As of 2014-11-27 23:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (190 votes), past polls