Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing html pages using perl 1

Status
Not open for further replies.

thendal

Programmer
Aug 23, 2000
284
Hai!

is there any way that i can print a bunch of html pages with single click of a button.For example i have a manual which comes out as 50 html pages.

If the user need to print this he has to go each and every page and click the print button .

I think there will be some possiblities in perl
where we can feed 50 html pages to the printer
at a time.Any help will be appriciated.

Thanks.
 
Try this little script. It should do the job for you. Just replace the value of $directory with where ever your manual is.


$directory = "put directory here";

while (defined($filename = glob("$directory/*.htm*")) )
{
open (HTML, "$filename") or die "Can't open HTML page: $!";
while ($_ = <HTML>)
{
print $_;
}
close (HTML) or die &quot;Can't close HTML page: $!&quot;;
}
 
Thanks for your response,i am afraid you misunderstood my question I just want to print it in a printer not as print output.
I don't know whether some module out there for this.

Regards,
Thendal
 
will the user be doing this through the internet? you can't alter the functionality of the user's browser, and it is made to only print one webpage at a time. all you can do is have a page that is the complete 50 page manual concatenated together, then let the user print that. well, unless there is a way built into browsers that lets you designate what get's printed (using html or javascript or something else i'm not an expert at), in which case yes, and you'd just have it print out the data returned from the script Rieekan posted. &quot;If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito.&quot;
 
Sorry about my confusion, I assumed that you wanted the users to be able to print all of the HTML pages at once. I use that script myself when I write what I call techtips for some users of our systems at my workplace. That way I can just read the entire tip even if it spans more than one page without having to click the link.

It also helps when management wants me to put it into a document format because they want to do whatever with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top