특정 부분 인쇄하기
페이지 정보
작성자 MintState 댓글 0건 조회 13,307회 작성일 08-11-17 13:11본문
특정 부분 인쇄하기
특정 부분을 지정 하여서 프린트 하는 방법 입니다.
첨부파일을 확인하세요..
특정 부분을 지정 하여서 프린트 하는 방법 입니다.
첨부파일을 확인하세요..
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>인쇄페이지</title>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function startPrint() {
var openerURL = opener.location.pathname;
var openerIndex = openerURL.lastIndexOf("/") + 1;
var openerPath = openerURL.substr(0, openerIndex);
openerPath = escape(openerPath);
var newContent = opener.forPrint.innerHTML;
newContent = escape(newContent)
newContent = AbsolutePath(newContent,"%22../",openerPath);
newContent = AbsolutePath(newContent,"%27../",openerPath);
newContent = AbsolutePath(newContent,"%3D../",openerPath);
document.all.forPrint.innerHTML = unescape(newContent);
window.print();
}
function AbsolutePath(contentstr,findstr,restr){
var temp="";
var r;
do{
r=contentstr.indexOf(findstr,0);
if(r>0){
temp=temp+contentstr.substring(0,r+3);
temp=temp+restr;
contentstr=contentstr.substring(r+3,contentstr.length);
}
}while(r>0)
temp=temp+contentstr;
return temp;
}
//-->
</SCRIPT>
</head>
<body onload="Javascript:startPrint();">
<DIV ID="forPrint"></DIV>
</body>
</html>
<script type="text/javascript">
function contentPrint() {
var windowLeft = (screen.width-640)/2;
var windowTop = (screen.height-480)/2;
var printURL = "./forPrint.html";
window.open(printURL,"print",'width=665, height=550, menubar=no, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
}
</script>
<a href="javascript:contentPrint();" title="인쇄하기">인쇄하기</a>
<div id="forPrint">
인쇄 내용<br />인쇄내용<br />
인쇄 내용<br />인쇄내용<br />
인쇄 내용<br />인쇄내용<br />
인쇄 내용<br />인쇄내용<br />
</div>|
|
댓글목록
등록된 댓글이 없습니다.





특정 부분 인쇄하기