You cannot see this page without javascript.

인쇄할 영역만 인쇄

Programing 조회 수 1011 추천 수 0 2013.12.06 22:07:38

1.특정부분인쇄
2.웹페이지 주소안나옴
3.헤더와푸터를 맘대로
4.한페이지가 넘어갈경우 중간에 짤리지 않고 깔끔하게 다음장으로 ;;
<head>
<!-- 헤드사이에 스크립트를 넣습니다. -->
<SCRIPT>
function pagePrint(Obj) {
var W = Obj.offsetWidth;        //screen.availWidth;
var H = Obj.offsetHeight;        //screen.availHeight;
var features = "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=" + W + ",height=" + H + ",left=0,top=0";
var PrintPage = window.open("about:blank",Obj.id,features);
PrintPage.document.open();
PrintPage.document.write("<html><head><title></title><style type='text/css'>body, tr, td, input, textarea { font-family:굴림; font-size:12px; }</style>n </head>n<body>" + Obj.innerHTML + "n</body></html>");
PrintPage.document.close();
PrintPage.document.title = document.domain;
PrintPage.printWindow(PrintPage.location.reload());
}
</SCRIPT>
</head>
<!--그리고 인쇄할곳을 찾아서 div 태그로 감싸줍니다.-->
<body>
<table BORDER=1>
 <tr>
  <td> 인쇄 안할곳<br>
   <a href="javascript:pagePrint(d2)">인쇄 해야할곳만 인쇄하자~!</a> </td>
 </tr>
</table>
<DIV ID="d2">
<script>
function printWindow() {
 factory.printing.header = "헤더의 내용";
 factory.printing.footer = "푸터의 내용";
 factory.printing.portrait = true; //false 로할경우 가로방향으로 출력합니다.
 factory.printing.leftMargin = 20.0;//마진값은 적당하게 주시면 됩니다.
 factory.printing.topMargin = 1.0;
 factory.printing.rightMargin = 1.0;
 factory.printing.bottomMargin = 1.0;
 factory.printing.Print(false);
}
</script>
<object id=factory style='display:none'  classid='clsid:1663ed61-23eb-11d2-b92f-008048fdd814'  codebase='자기서버에 파일위치/smsx.cab#Version=6,4,438,06'>
</object>
<table BORDER=1>
 <tr>
  <td> 인쇄 해야할곳!!!! </td>
 </tr>
</table>
</DIV>
</body>
이렇게 하시면 인쇄 하기 버튼을 누르시면
새창이뜨면서 인쇄할 영역만 보여지고 인쇄창이 뜨게 됩니다.


smsx.cab

첨부
엮인글 :
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
269 아레한글 사용시 출력물에 음영이 나타나는 현상. file [11] LynX 2012-03-29 1077
268 Linux LFS/Preface - 서문 [9] LynX 2014-08-06 1072
267 CentOS7 ▒ Doly의 CentOS7 강좌10 3. CentOS시작, 종료, 둘러보기 -2 file [17] LynX 2014-10-23 1071
266 APM APM 기본적인 점검 LynX 2013-12-27 1064
265 CentOS APM 소스 설치 file [15] LynX 2015-05-29 1053
264 Linux MySQL 5.1.73 바이너리 설치 LynX 2014-07-02 1049
263 Xpress Engine XE 애드온(addon)개발하기 LynX 2014-07-11 1044
262 Server 전산업무 리스트 LynX 2016-05-20 1028
261 Linux 리눅스 게이밍 가이드 1부 : 게임을 위한 환경 설정 [10] LynX 2014-12-24 1027
260 CentOS7 ▒ Doly의 CentOS7 강좌2 1.리눅스의 이해 file [13] LynX 2014-10-23 1023
259 Linux roundcube 설치 [14] LynX 2014-08-25 1013
» Programing 인쇄할 영역만 인쇄 file LynX 2013-12-06 1011
257 CentOS mariadb install LynX 2019-05-31 1003
256 Server OpenSSL LynX 2014-06-19 986
255 APM 무료 ssl 설치 LynX 2013-12-21 986
254 Server 윈도우7(Window)에 DNS서버(acrylic-from sourceforge) 설치하는 방법 file LynX 2014-05-14 981
253 HTML Tag JWPlayer 사용법 #2 포맷 [14] LynX 2013-06-25 977
252 Linux Bomi Player [24] LynX 2015-02-27 975
251 APM Apache httpd mod_security2 적용 file LynX 2017-02-09 973
250 CentOS CentOS 에 설치된 커널과 오랜된 커널 삭제하기 LynX 2014-12-30 970

XE Login