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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print invis-Can I Do this?

Status
Not open for further replies.

reebow

Technical User
Sep 4, 2004
4
GB
Hi guys,

I need to print say three pages without the user having to see them, - the user clicks a button, and an application form prints documents server side.

Any help would be most apreciated

Cheers
 
an application form prints documents server side.

Are you certain about this? Normally, the user prints documents on the client-side and there is no way to make this an "invisible" process. If it truly is printing through the server-side, then I can't see any problems unless the user has to select a network printer OR you are using a Windows based server.

There's always a better way. The fun is trying to find it!
 
Thanks tviman,

server side was probably the wrong explaination.
What I mean is that at the click of a button the user prints the application form without viewing them.
I am prone to talking s**t sometimes!


Cheers
 
Not sure if its the best way.

But you could use CSS to create some invisible pages and specify a Print stylesheet that makes them visible.

 
Here's one way to do it. In the <head> of the page where the user requests the form, put this line:
Code:
<link rel="alternate" media="print" href="form.htm" type="text/html" />
where form.htm is the URL of the application form. This tells the browser to print that page instead of the current one when the print button is pressed.

Then you just need a bit of Javascript (unfortunately you have to just hope that your users have it switched on...) :
Code:
<form>
<input type="button" value="Request Form" onclick="window.print();" />
</form>

-- Chris Hunt
 
This works fine, its exactly what I wanted.
Many thanks!

But how can I manipulate the code to print
three documents/pages, appform1,appform2,appform3?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top