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