View Full Version : printing a html page

08-22-2002, 04:23 PM
how do i get my server to write the contents of session oject and print it on a printer attached to the printer????

thanks for the help:thumbsup:

Roy Sinclair
08-23-2002, 09:03 PM
You'd need a custom control to write a printer in ASP. Why not just use response.write to send it to the web page you're debugging. If you aren't debugging then write it to a text file or database and use some other job to print it from there. To enumerate the session variables use for each x in Session.

08-23-2002, 09:19 PM
If you are using VB, there are specific objects that are available in runtime apps, the Printer and Printers Objects. (Printers gives you information about all printers available on the system, the Printer object--nice if they could have named them a bit better--gives you information about the active printer like its name and controls all printer output)

Printer.Print "I am a tiny printed page, short and stout"

But each Printer.Print line goes to a new line...

Printer.Print "I am a tiny printed page, short and stout"
Printer.Print "You are not tiny, you wee git!"

would literally be

I am a tiny printed page, short and stout
You are not tiny, you wee git!

Printer.NewPage would give you a new page and Printer.EndDoc would end the printing.

You can also specify the printer font name and other style elements, but it gets lengthy, so try here for a rundown: http://www.vbinformation.com/tut-prnt.htm

Roy's right, Blue...it is often easier (in comparison) to do a printer friendly version rather than going straight to the printer...though a COM object can make it easier (if you are comfortable enough for it). And dotNet (dotSpew) does make it easier, though it has a complete lack of basic logic in some areas...

Take a look at a few of these for some ideas that may give you some better insight:



08-27-2002, 09:05 AM
thank you for all the help