Copie o código do código da seguinte forma:
<%@Page Language = "Java" contentType = "text/html; charset = utf-8"
PageEncoding = "UTF-8"%>
<!
<html>
<head>
<title> Javascript Print-Print Page Settings-Print Preview Code </ititle>
<Meta http-equiv = content-type content = "text /html; charset = gb2312" />
<Estilo mídia = impressão>
.Noprint {Display: Nenhum;}
.Pagenext {Page-Break-After: sempre;}
</style>
<idioma de script = javascript>
function propsetup () {
// Configurações da página de impressão
wb.execwb (8,1);
}
Fuinction proPreview () {{)
// Visualização da página de impressão
wb.execwb (7,1);
}
Função Printit ()
{{
if (confirm ('você está impresso?') {
wb.execwb (6,6)
}
}
</Script>
</head>
<Body>
<Div align = Center>
<Objeto id = altura wb = 0 largura = 0
ClassID = CLSID: 8856F961-340A-11D0-A96B-004FD705A2 NOME = WB> </Objeção>
<Input onclight = javascript: printit () type = button value = imprimir nome = button_print />
<Input onclight = javascript: printSetup ();
<Input onclight = javascript: printPreview ();
</div>
111 </br>
111 </br>
111 </br>
<div> </div>
222 </br>
222 </br>
222 </br>
<div> </div>
333 </br>
333 </br>
333 </br>
<div> </div>
444 </br>
444 </br>
444 </br>
<div> </div>
555 </br>
555 </br>
555 </br>
</Body>
</html>
Copie o código do código da seguinte forma:
<html>
Solução de impressão em lote de paging <título> (suporta apenas o IE) </title>
<Script Language = "JavaScript">
Função printwithalert () {
document.all.webbrowser.execwb (6,1);
}
Função printwithoutorert () {
document.all.webbrowser.execwb (6,6);
}
function propsetup () {
document.all.webbrowser.execwb (8,1);
}
function propPriview () {
document.all.webbrowser.execwb (7,1);
}
function printimdiaately () {
document.all.webbrowser.execwb (6,6);
window.close ();
}
</script>
<Object ID = WebBrowser ClassID = CLSID: 8856F961-340A-11D0-A96B-004FD705A2 STILO = "Display: None">
</ject>
</noscript>
<Estilo mídia = impressão>
.Noprint {Display: Nenhum;} .Pagenext {Page-Break-ACT: sempre;}
</style>
<Tabela align = "Center" Class = NOTRINT>
<tr>
<td align = "Center"> <Button Title = Print OnClick = PrintWithalert ()> Print </butut>
<Button title = Imprima diretamente onclick = printwithouterert ()> Imprima diretamente </butut>
<Tipo de entrada = Button Value = "Imprimir Configurações" OnClick = "PrintSetup ()">
<Button onclick = 'privriview ()' title = 'Imprimir visualização ...'> Imprimir visualização </botão> </td>
</tr>
</tabela>
<div class = notrint> abaixo está a área de impressão: <br>
</div>
<hr size = 1 noshadow cor = Black Class = Noprint>
<Tabela>
<tr>
<td colorpan = 2>
O conteúdo da primeira página
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</td>
</tr>
</tabela>
<hr size = 1 noshadow cor = Black Class = Noprint>
<div>
Conteúdo da segunda página
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</div>
<hr size = 1 noshadow cor = Black Class = Noprint>
Conteúdo da terceira página
</html>