Connecting Tech Pros Worldwide Forums | Help | Site Map

Printing HTML

Gerard Jonker
Guest
 
Posts: n/a
#1: Jul 20 '05
Hello

I am busy with a web-based sofware solution using PHP and MySQL.
Is it possible to use a HTML document to produce a filled in form on
paper without showing this HTML document on the screen?

Gerard Jonker

Gerard Jonker
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Printing HTML


In article <bebee6$utn$1@newsg1.svr.pol.co.uk>, Ben M
<cee.plus@virgin.net> wrote:
[color=blue][color=green]
> > Hello
> >
> > I am busy with a web-based sofware solution using PHP and MySQL.
> > Is it possible to use a HTML document to produce a filled in form on
> > paper without showing this HTML document on the screen?
> >
> > Gerard Jonker[/color]
>
> Use CSS to hide the form when viewing in screen media and display it in
> print media.
>
> very brief example:
>
> in HTML:
> ...
> <head>
> ...
> <link rel="stylesheet" type="text/css" media="print" href="print.css">
> <link rel="stylesheet" type="text/css" media="screen" href="screen.css">
> </head>
> ...
> <form class="printonly" ...>
> ...
> </form>
>
> in print.css
>
> .printonly {display:block};
>
> in screen.css
>
> .printonly {display:none};[/color]

Hello

Thanks for your reply but can you please be more specific.
My HTML document that has to be printed is placed into an Iframe that
is not visible (dimensions zero). For the printing I try to use the
following Javascript function:
{
document.nameofiframe.focus();
document.nameofiframe.print();
}
but this does not work.
If I am totally wrong please give me more details about your method.

Gerard Jonker
Closed Thread