1753370 Members
4984 Online
108792 Solutions
New Discussion юеВ

Re: Printing HTML

 
SOLVED
Go to solution
Troyan Krastev
Regular Advisor

Printing HTML

Hi All,

I collect a lot of information about my intranet using MRTG.
Now my manager want me to send him statistics for every month.

Is there any utility/way for printing .HTML files with .PNG images.
I need it for Shell or Perl scripts.

Thanks.
3 REPLIES 3
Shannon Petry
Honored Contributor

Re: Printing HTML

If you have to have the images, there is no way I know of from script. The layout of HTML can be complex, and embed images anywhere, and text anywhere.

If I were in your shoes, I would look at the following.
1. Use sed to strip html tags and url's to get the plain text from the file.
2. email him direct html, or use netscape to print interactively.

gimp has some nice scripting features to allow translation of images from the command line, but this does not fix the html text and formating problems.

Regards,
Shannon
Microsoft. When do you want a virus today?
Ulrich Deiters
Frequent Advisor
Solution

Re: Printing HTML

You are asking something difficult!
You can call Netscape from a script:
netscape -remote "openURL()"

... and save the page to a file:
netscape -remote \ "saveAs(,Source)"

You can then analyze for the
URLs of links, embedded graphics, etc.,
and download and save them in a
similar way for further processing.

netscape -remote "print()"
prints the top browser window.

Tim Malnati
Honored Contributor

Re: Printing HTML

You might take a look at the netpbm tools located at http://sourceforge.net/projects/netpbm Thay have some limited capabilities to extract text from graphical .png files.