You cannot see this page without javascript.

인쇄할 영역만 인쇄

Programing 조회 수 1016 추천 수 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
89 CentOS7 ▒ Doly의 CentOS7 강좌14 5. CentOS 기본설정 1 - 키보드 및 마우스 설정 file [14] LynX 2014-10-23 1247
88 IIS에 FastCgi모듈 활성화 시키기 file [12] LynX 2012-11-21 1249
87 Linux firewall 설정 [1] LynX 2014-08-25 1255
86 CentOS7 ▒ Doly의 CentOS7 강좌4-2.CenOS 7 설치-2 file [12] LynX 2014-10-23 1258
85 윈도우 아파치 설치 [14] LynX 2013-03-23 1262
84 Windows 윈도우 설치 원본 통합 file LynX 2014-05-26 1273
83 CentOS7 ▒ Doly의 CentOS7 강좌5 - 2.CenOS 7 설치-3 file [9] LynX 2014-10-23 1282
82 APM What one can and should optimize LynX 2019-06-03 1296
81 PHP, Wincache를 포함해 IIS에서 XE를 설정하는 방법 file [13] LynX 2012-12-15 1302
80 Linux 부트 시스템 만들기 [10] LynX 2015-01-05 1343
79 Xpress Engine xe 포인트 레벨과 등급 동기화 에드온 2.0 file LynX 2016-09-21 1419
78 Linux Xming 으로 X-Window 원격 접속 하기 LynX 2014-07-07 1420
77 CentOS APM 소스설치 rev.2 LynX 2016-05-26 1422
76 CentOS centos7 gcc-4.9.2 compile install LynX 2017-01-25 1454
75 APM ext zip install LynX 2019-02-19 1493
74 Windows XP XP 원본 이미지에 AHCI 드라이버 통합 file [6] LynX 2013-06-20 1521
73 APM php opcache 설치 file LynX 2016-10-14 1527
72 Server DNS [25] LynX 2015-07-16 1597
71 Linux centOS FTP서버 구축 file LynX 2014-07-03 1599
70 Server 서버관리/운용지침 메뉴얼 LynX 2016-05-20 1606

XE Login