次のようにコードコードをコピーします。
<%@ページ言語= "java" contentType = "text/html; charset = utf-8"
PageEncoding = "UTF-8"%>
<
<html>
<head>
<title> javascript印刷プリントページ設定プリントプレビューコード</title>
<メタhttp-equiv = content-type content = "text /html; charset = gb2312" />
<スタイルメディア= print>
.noprint {display:none;}
.pagenext {page-break-after:altweer;}
</style>
<スクリプト言語= javascript>
Fuinction Propsetup(){
//ページ設定を印刷します
wb.execwb(8,1);
}
FuinctionPropreview(){{)
//ページのプレビューを印刷します
wb.execwb(7,1);
}
functionprintit()
{{
if(confiden( '印刷されていますか?'){
wb.execwb(6,6)
}
}
</script>
</head>
<body>
<div align = center>
<オブジェクトid = wb height = 0 width = 0
ClassID = CLSID:8856F961-340A-11D0-A96B-004FD705A2 name = wb> </depplice>
<入力onclight = javascript:printit()type = button value = print name = button_print />
<入力onclight = javascript:printsetup();
<入力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>
次のようにコードコードをコピーします。
<html>
<Title> JSページングバッチ印刷ソリューション(IEのみをサポート)</title>
<スクリプト言語= "javascript">
関数printwithalert(){
document.all.webbrowser.execwb(6,1);
}
function printwithoutorert(){
document.all.webbrowser.execwb(6,6);
}
Fuinction Propsetup(){
document.all.webbrowser.execwb(8,1);
}
関数propprieview(){
document.all.webbrowser.execwb(7,1);
}
関数printimdiayally(){
document.all.webbrowser.execwb(6,6);
window.close();
}
</script>
<オブジェクトID = webbrowser classID = clsid:8856f961-340a-11d0-a96b-004fd705a2 style = "display:none">
</object>
</noscript>
<スタイルメディア= print>
.noprint {display:none;} .pageNext {page-break-act:always;}
</style>
<table align = "center" class = notrint>
<tr>
<td align = "center"> <ボタンタイトル= print onclick = printwithalert()> print </button>
<ボタンタイトル=直接印刷onclick = printwithoutorert()>直接print </button>
<入力タイプ=ボタン値= "print settings" onclick = "printsetup()">
<ボタンonclick = 'printprieview()' title = 'print preview ...'> print preview </button> </td>
</tr>
</table>
<div class = notrint>以下は印刷領域です:<br>
</div>
<hr size = 1 noshadow color = black class = noprint>
<表>
<tr>
<td colorpan = 2>
最初のページのコンテンツ
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</td>
</tr>
</table>
<hr size = 1 noshadow color = black class = noprint>
<div>
セカンドページコンテンツ
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</div>
<hr size = 1 noshadow color = black class = noprint>
3番目のページコンテンツ
</html>