Print Letter

G

Guest

Hi!

My web application requires the users to activate their account before they
can access to it. So, in order to activate their account, the administrators
have to assign activation passwords to them. After an administrator assigns
an activation password to the user, I'd like to print out a letter, or create
a text file with the contents of the letter, the user's name and activation
password on it (right after clicking the Assign button). Is there any way
that I can accomplish?

Thank you.
 
M

Mark Rae

an activation password to the user, I'd like to print out a letter, or
create
a text file with the contents of the letter, the user's name and
activation
password on it (right after clicking the Assign button). Is there any way
that I can accomplish?

Are you expecting the webserver to send something to a printer on the
network it's connected to, or are you expecting the client machine to send
something to its own printer?

Similarly, do you want the server or the client to save the text file?
 
G

Guest

Are you expecting the webserver to send something to a printer on the
network it's connected to, or are you expecting the client machine to send
something to its own printer?
Similarly, do you want the server or the client to save the text file?

I'm actually expecting something to happen at the client. For e.g., maybe a
file (be text, doc, pdf and etc) with the letter content) to appear on the
screen at the client side so that he can print it. Or better still the
printer connected to the client machine starts to print the letter. Is this
possible?
 
M

Mark Rae

I'm actually expecting something to happen at the client. For e.g., maybe
a
file (be text, doc, pdf and etc) with the letter content) to appear on the
screen at the client side so that he can print it.

That's easy enough, provided you have some mechanism on the webserver
capable of generating a PDF which doesn't involve using something like
Microsoft Word. There are loads of 3rd-party components available which will
convert HTML / XML into PDF on the fly - do a Google search.
Or better still the printer connected to the client machine starts to
print the letter.
Is this possible?

Yes, but very tricky, and can't be guaranteed to work. What if the printer
is off-line? What if the client doesn't want the document to be printed?
What if they're using a different PC which doesn't have a printer attached?
Etc.

Do yourself a favour and simply stream the document to the client browser,
allowing the clients themselves to choose whether to print it or not...

An even simpler solution would be to create a "printable" page i.e. very few
graphics etc, which can be printed directly from the client's browser.
You've probably seen similar functionality when purchasing goods on-line...
 
G

Guest

An even simpler solution would be to create a "printable" page i.e. very few
graphics etc, which can be printed directly from the client's browser.
You've probably seen similar functionality when purchasing goods on-line...

Thank you for all your suggestions. Actually I'll like to make a printable
page, but if the user prints from the browser, the printout will have the url
at the footer and the title and number of pages at the header, which is not
presentable for a letter. Is there anyway to remove the footer and header
when you print from browser?
 
M

Mark Rae

Thank you for all your suggestions. Actually I'll like to make a printable
page, but if the user prints from the browser, the printout will have the
url
at the footer and the title and number of pages at the header, which is
not
presentable for a letter. Is there anyway to remove the footer and header
when you print from browser?

No - you'll have to stream a PDF or similar...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top