You cannot see this page without javascript.

print script

Programing 조회 수 303 추천 수 0 2013.12.11 15:34:40
1. 프린트 할 영역의 테이블에 id 값을 준다

ex ) <table id="print_doc"> 생략... </table>

2. 프린트 할곳에 해당 스크립트 와 iframe를 하단에 삽입하며 클릭 버튼을 넣어준다.


<input type="button" value="프린트" onclick="print_();"> <!-- 버튼 넣고싶은곳에 넣는다.-->

<iframe id="hiddenFrame" name="hiddenFrame" width="0" height="0"></iframe> <!-- 팝업을 뛰우지 않기위해-->

<script language="Javascript" type="text/javascript">
<!--
function print_() {
    window.open("./print_hidden.php", "hiddenFrame");
    window.frames['hiddenFrame'].focus();
}
//-->
</script>

3. 같은 디렉토리 안에 print_hidden.php 아래 내용을 넣어서 파일을 생상한다.

<html>
<title>프린트</title>
<body leftmargin=0 topmargin=0></body>
</html>

<script language="Javascript" type="text/javascript">
<!--
function print_() {
    window.print();
}
var base = parent.location.href;
var body = parent.document.getElementById('print_doc').innerHTML;
document.body.innerHTML = "<BASE HREF='"+base+"'>" + body;
window.onload = print_;
//-->
</script>

엮인글 :
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